<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE GADTs #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Monad for Stg to C-- code generation</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- (c) The University of Glasgow 2004-2006</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.StgToCmm.Monad</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier">FCode</span></a></span><span class="hs-special">,</span><span>        </span><span class="hs-comment">-- type</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initC"><span class="hs-identifier">initC</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#runC"><span class="hs-identifier">runC</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#fixC"><span class="hs-identifier">fixC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier">newUnique</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitLabel"><span class="hs-identifier">emitLabel</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier">emit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier">emitDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProcWithConvention"><span class="hs-identifier">emitProcWithConvention</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProcWithStackFrame"><span class="hs-identifier">emitProcWithStackFrame</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitOutOfLine"><span class="hs-identifier">emitOutOfLine</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier">emitAssign</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitStore"><span class="hs-identifier">emitStore</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitComment"><span class="hs-identifier">emitComment</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitTick"><span class="hs-identifier">emitTick</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitUnwind"><span class="hs-identifier">emitUnwind</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCmm"><span class="hs-identifier">getCmm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#aGraphToGraph"><span class="hs-identifier">aGraphToGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier">getPlatform</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCodeR"><span class="hs-identifier">getCodeR</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCode"><span class="hs-identifier">getCode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCodeScoped"><span class="hs-identifier">getCodeScoped</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getHeapUsage"><span class="hs-identifier">getHeapUsage</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse"><span class="hs-identifier">mkCmmIfThenElse</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen"><span class="hs-identifier">mkCmmIfThen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto"><span class="hs-identifier">mkCmmIfGoto</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse%27"><span class="hs-identifier">mkCmmIfThenElse'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen%27"><span class="hs-identifier">mkCmmIfThen'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto%27"><span class="hs-identifier">mkCmmIfGoto'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCall"><span class="hs-identifier">mkCall</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmCall"><span class="hs-identifier">mkCmmCall</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkClosureBody"><span class="hs-identifier">forkClosureBody</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkLneBody"><span class="hs-identifier">forkLneBody</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkAlts"><span class="hs-identifier">forkAlts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkAltPair"><span class="hs-identifier">forkAltPair</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#codeOnly"><span class="hs-identifier">codeOnly</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Types.Basic.html#ConTagZ"><span class="hs-identifier">ConTagZ</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier">Sequel</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#ReturnKind"><span class="hs-identifier">ReturnKind</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#withSequel"><span class="hs-identifier">withSequel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getSequel"><span class="hs-identifier">getSequel</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setTickyCtrLabel"><span class="hs-identifier">setTickyCtrLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getTickyCtrLabel"><span class="hs-identifier">getTickyCtrLabel</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#tickScope"><span class="hs-identifier">tickScope</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier">getTickScope</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#withUpdFrameOff"><span class="hs-identifier">withUpdFrameOff</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getUpdFrameOff"><span class="hs-identifier">getUpdFrameOff</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initUpdFrameOff"><span class="hs-identifier">initUpdFrameOff</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier">HeapUsage</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier">VirtualHpOffset</span></a></span><span class="hs-special">,</span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initHpUsage"><span class="hs-identifier">initHpUsage</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getHpUsage"><span class="hs-identifier">getHpUsage</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setHpUsage"><span class="hs-identifier">setHpUsage</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#heapHWM"><span class="hs-identifier">heapHWM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setVirtHp"><span class="hs-identifier">setVirtHp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getVirtHp"><span class="hs-identifier">getVirtHp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setRealHp"><span class="hs-identifier">setRealHp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getModuleName"><span class="hs-identifier">getModuleName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span>        </span><span class="hs-comment">-- ideally we wouldn't export these, but some other modules access internal state</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier">getState</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier">setState</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getSelfLoop"><span class="hs-identifier">getSelfLoop</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#withSelfLoop"><span class="hs-identifier">withSelfLoop</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier">getInfoDown</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier">getDynFlags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>        </span><span class="hs-comment">-- more localised access to monad state</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier">CgIdInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getBinds"><span class="hs-identifier">getBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setBinds"><span class="hs-identifier">setBinds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span>        </span><span class="hs-comment">-- out of general friendliness, we also export ...</span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgInfoDownwards"><span class="hs-identifier">CgInfoDownwards</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier">CgState</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- non-abstract</span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier">sequence</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Enum.html#succ"><span class="hs-identifier">succ</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html"><span class="hs-identifier">GHC.StgToCmm.Closure</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html"><span class="hs-identifier">GHC.Cmm.Graph</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">CmmGraph</span></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#ConTagZ"><span class="hs-identifier">ConTagZ</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- The FCode monad and its types</span><span>
</span><span id="line-91"></span><span class="hs-comment">--</span><span>
</span><span id="line-92"></span><span class="hs-comment">-- FCode is the monad plumbed through the Stg-&gt;Cmm code generator, and</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- the Cmm parser.  It contains the following things:</span><span>
</span><span id="line-94"></span><span class="hs-comment">--</span><span>
</span><span id="line-95"></span><span class="hs-comment">--  - A writer monad, collecting:</span><span>
</span><span id="line-96"></span><span class="hs-comment">--    - code for the current function, in the form of a CmmAGraph.</span><span>
</span><span id="line-97"></span><span class="hs-comment">--      The function &quot;emit&quot; appends more code to this.</span><span>
</span><span id="line-98"></span><span class="hs-comment">--    - the top-level CmmDecls accumulated so far</span><span>
</span><span id="line-99"></span><span class="hs-comment">--</span><span>
</span><span id="line-100"></span><span class="hs-comment">--  - A state monad with:</span><span>
</span><span id="line-101"></span><span class="hs-comment">--    - the local bindings in scope</span><span>
</span><span id="line-102"></span><span class="hs-comment">--    - the current heap usage</span><span>
</span><span id="line-103"></span><span class="hs-comment">--    - a UniqSupply</span><span>
</span><span id="line-104"></span><span class="hs-comment">--</span><span>
</span><span id="line-105"></span><span class="hs-comment">--  - A reader monad, for CgInfoDownwards, containing</span><span>
</span><span id="line-106"></span><span class="hs-comment">--    - DynFlags,</span><span>
</span><span id="line-107"></span><span class="hs-comment">--    - the current Module</span><span>
</span><span id="line-108"></span><span class="hs-comment">--    - the update-frame offset</span><span>
</span><span id="line-109"></span><span class="hs-comment">--    - the ticky counter label</span><span>
</span><span id="line-110"></span><span class="hs-comment">--    - the Sequel (the continuation to return to)</span><span>
</span><span id="line-111"></span><span class="hs-comment">--    - the self-recursive tail call information</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-keyword">newtype</span><span> </span><span id="FCode"><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span></span><span> </span><span id="local-6989586621681050699"><span class="annot"><a href="#local-6989586621681050699"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FCode"><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="doFCode"><span class="annot"><span class="annottext">forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgInfoDownwards"><span class="hs-identifier hs-type">CgInfoDownwards</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050699"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050369"><span id="local-6989586621681050371"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; FCode a -&gt; FCode b)
-&gt; (forall a b. a -&gt; FCode b -&gt; FCode a) -&gt; Functor FCode
forall a b. a -&gt; FCode b -&gt; FCode a
forall a b. (a -&gt; b) -&gt; FCode a -&gt; FCode b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; FCode b -&gt; FCode a
$c&lt;$ :: forall a b. a -&gt; FCode b -&gt; FCode a
fmap :: forall a b. (a -&gt; b) -&gt; FCode a -&gt; FCode b
$cfmap :: forall a b. (a -&gt; b) -&gt; FCode a -&gt; FCode b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681050358"><span id="local-6989586621681050360"><span id="local-6989586621681050362"><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-119"></span><span>    </span><span id="local-6989586621681050356"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; FCode a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621681050355"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050355"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681050354"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050354"><span class="hs-identifier hs-var">_info_down</span></a></span></span><span> </span><span id="local-6989586621681050353"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050353"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050355"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050353"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621681050351"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. FCode (a -&gt; b) -&gt; FCode a -&gt; FCode b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode (a -&gt; b) -&gt; FCode a -&gt; FCode b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681050343"><span id="local-6989586621681050345"><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-124"></span><span>    </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span id="local-6989586621681050341"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="#local-6989586621681050341"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621681050340"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. FCode a -&gt; (a -&gt; FCode b) -&gt; FCode b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621681050339"><span class="annot"><span class="annottext">a -&gt; FCode b
</span><a href="#local-6989586621681050339"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (b, CgState)) -&gt; FCode b
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; (b, CgState)) -&gt; FCode b)
-&gt; (CgInfoDownwards -&gt; CgState -&gt; (b, CgState)) -&gt; FCode b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-125"></span><span>        </span><span class="hs-glyph">\</span><span id="local-6989586621681050338"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050338"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span id="local-6989586621681050337"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050337"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-126"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="#local-6989586621681050341"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050338"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050337"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-127"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681050336"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050336"><span class="hs-identifier hs-var">m_result</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050335"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050335"><span class="hs-identifier hs-var">new_state</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-128"></span><span>                 </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; FCode b
</span><a href="#local-6989586621681050339"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050336"><span class="hs-identifier hs-var">m_result</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-129"></span><span>                   </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span id="local-6989586621681050334"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (b, CgState)
</span><a href="#local-6989586621681050334"><span class="hs-identifier hs-var">kcode</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (b, CgState)
</span><a href="#local-6989586621681050334"><span class="hs-identifier hs-var">kcode</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050338"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050335"><span class="hs-identifier hs-var">new_state</span></a></span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;=</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681050328"><span class="annot"><a href="GHC.Types.Unique.Supply.html#MonadUnique"><span class="hs-identifier hs-type">MonadUnique</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-133"></span><span>  </span><span id="local-6989586621681050325"><span class="annot"><span class="annottext">getUniqueSupplyM :: FCode UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#getUniqueSupplyM"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUniqueSupplyM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var hs-var">cgs_uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; UniqSupply) -&gt; FCode CgState -&gt; FCode UniqSupply
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-134"></span><span>  </span><span id="local-6989586621681050321"><span class="annot"><span class="annottext">getUniqueM :: FCode Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUniqueM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (Unique, CgState)) -&gt; FCode Unique
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; (Unique, CgState)) -&gt; FCode Unique)
-&gt; (CgInfoDownwards -&gt; CgState -&gt; (Unique, CgState))
-&gt; FCode Unique
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681050319"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050319"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-135"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050318"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050318"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050317"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050317"><span class="hs-identifier hs-var">us'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState -&gt; UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var hs-var">cgs_uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050319"><span class="hs-identifier hs-var">st</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050318"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050319"><span class="hs-identifier hs-var">st</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_uniqs :: UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var">cgs_uniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050317"><span class="hs-identifier hs-var">us'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initC"><span class="hs-identifier hs-type">initC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span>
</span><span id="line-139"></span><span id="initC"><span class="annot"><span class="annottext">initC :: IO CgState
</span><a href="GHC.StgToCmm.Monad.html#initC"><span class="hs-identifier hs-var hs-var">initC</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050315"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050315"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'c'</span></span><span>
</span><span id="line-140"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; IO CgState
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-var">initCgState</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050315"><span class="hs-identifier hs-var">uniqs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span id="local-6989586621681050654"><span class="annot"><a href="GHC.StgToCmm.Monad.html#runC"><span class="hs-identifier hs-type">runC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050654"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050654"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-143"></span><span id="runC"><span class="annot"><span class="annottext">runC :: forall a. DynFlags -&gt; Module -&gt; CgState -&gt; FCode a -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#runC"><span class="hs-identifier hs-var hs-var">runC</span></a></span></span><span> </span><span id="local-6989586621681050312"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050312"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681050311"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681050311"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681050310"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050310"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span id="local-6989586621681050309"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050309"><span class="hs-identifier hs-var">fcode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050309"><span class="hs-identifier hs-var">fcode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Module -&gt; CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#initCgInfoDown"><span class="hs-identifier hs-var">initCgInfoDown</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050312"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681050311"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050310"><span class="hs-identifier hs-var">st</span></a></span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span id="local-6989586621681050652"><span class="annot"><a href="GHC.StgToCmm.Monad.html#fixC"><span class="hs-identifier hs-type">fixC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050652"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050652"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050652"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-146"></span><span id="fixC"><span class="annot"><span class="annottext">fixC :: forall a. (a -&gt; FCode a) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#fixC"><span class="hs-identifier hs-var hs-var">fixC</span></a></span></span><span> </span><span id="local-6989586621681050307"><span class="annot"><span class="annottext">a -&gt; FCode a
</span><a href="#local-6989586621681050307"><span class="hs-identifier hs-var">fcode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a)
-&gt; (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-147"></span><span>    </span><span class="hs-glyph">\</span><span id="local-6989586621681050306"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050306"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span id="local-6989586621681050305"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050305"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050304"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050304"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050303"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050303"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; FCode a
</span><a href="#local-6989586621681050307"><span class="hs-identifier hs-var">fcode</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050304"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050306"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050305"><span class="hs-identifier hs-var">state</span></a></span><span>
</span><span id="line-148"></span><span>                        </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050304"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050303"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-151"></span><span class="hs-comment">--        The code generator environment</span><span>
</span><span id="line-152"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-comment">-- This monadery has some information that it only passes</span><span>
</span><span id="line-155"></span><span class="hs-comment">-- *downwards*, as well as some ``state'' which is modified</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- as we go along.</span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-keyword">data</span><span> </span><span id="CgInfoDownwards"><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgInfoDownwards"><span class="hs-identifier hs-var">CgInfoDownwards</span></a></span></span><span>        </span><span class="hs-comment">-- information only passed *downwards* by the monad</span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="MkCgInfoDown"><span class="annot"><a href="GHC.StgToCmm.Monad.html#MkCgInfoDown"><span class="hs-identifier hs-var">MkCgInfoDown</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-160"></span><span>        </span><span id="cgd_dflags"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; DynFlags
</span><a href="GHC.StgToCmm.Monad.html#cgd_dflags"><span class="hs-identifier hs-var hs-var">cgd_dflags</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-161"></span><span>        </span><span id="cgd_mod"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Module
</span><a href="GHC.StgToCmm.Monad.html#cgd_mod"><span class="hs-identifier hs-var hs-var">cgd_mod</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- Module being compiled</span><span>
</span><span id="line-162"></span><span>        </span><span id="cgd_updfr_off"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#cgd_updfr_off"><span class="hs-identifier hs-var hs-var">cgd_updfr_off</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#UpdFrameOffset"><span class="hs-identifier hs-type">UpdFrameOffset</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- Size of current update frame</span><span>
</span><span id="line-163"></span><span>        </span><span id="cgd_ticky"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CLabel
</span><a href="GHC.StgToCmm.Monad.html#cgd_ticky"><span class="hs-identifier hs-var hs-var">cgd_ticky</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- Current destination for ticky counts</span><span>
</span><span id="line-164"></span><span>        </span><span id="cgd_sequel"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Sequel
</span><a href="GHC.StgToCmm.Monad.html#cgd_sequel"><span class="hs-identifier hs-var hs-var">cgd_sequel</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier hs-type">Sequel</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- What to do at end of basic block</span><span>
</span><span id="line-165"></span><span>        </span><span id="cgd_self_loop"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Maybe SelfLoopInfo
</span><a href="GHC.StgToCmm.Monad.html#cgd_self_loop"><span class="hs-identifier hs-var hs-var">cgd_self_loop</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#SelfLoopInfo"><span class="hs-identifier hs-type">SelfLoopInfo</span></a></span><span class="hs-special">,</span><span class="hs-comment">-- Which tail calls can be compiled</span><span>
</span><span id="line-166"></span><span>                                            </span><span class="hs-comment">-- as local jumps? See Note</span><span>
</span><span id="line-167"></span><span>                                            </span><span class="hs-comment">-- [Self-recursive tail calls] in</span><span>
</span><span id="line-168"></span><span>                                            </span><span class="hs-comment">-- GHC.StgToCmm.Expr</span><span>
</span><span id="line-169"></span><span>        </span><span id="cgd_tick_scope"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#cgd_tick_scope"><span class="hs-identifier hs-var hs-var">cgd_tick_scope</span></a></span></span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmTickScope"><span class="hs-identifier hs-type">CmmTickScope</span></a></span><span>       </span><span class="hs-comment">-- Tick scope for new blocks &amp; ticks</span><span>
</span><span id="line-170"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-keyword">type</span><span> </span><span id="CgBindings"><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgBindings"><span class="hs-identifier hs-var">CgBindings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#IdEnv"><span class="hs-identifier hs-type">IdEnv</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-keyword">data</span><span> </span><span id="CgIdInfo"><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-var">CgIdInfo</span></a></span></span><span>
</span><span id="line-175"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="CgIdInfo"><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-var">CgIdInfo</span></a></span></span><span>
</span><span id="line-176"></span><span>        </span><span class="hs-special">{</span><span> </span><span id="cg_id"><span class="annot"><span class="annottext">CgIdInfo -&gt; Id
</span><a href="GHC.StgToCmm.Monad.html#cg_id"><span class="hs-identifier hs-var hs-var">cg_id</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>   </span><span class="hs-comment">-- Id that this is the info for</span><span>
</span><span id="line-177"></span><span>        </span><span class="hs-special">,</span><span> </span><span id="cg_lf"><span class="annot"><span class="annottext">CgIdInfo -&gt; LambdaFormInfo
</span><a href="GHC.StgToCmm.Monad.html#cg_lf"><span class="hs-identifier hs-var hs-var">cg_lf</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#LambdaFormInfo"><span class="hs-identifier hs-type">LambdaFormInfo</span></a></span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-special">,</span><span> </span><span id="cg_loc"><span class="annot"><span class="annottext">CgIdInfo -&gt; CgLoc
</span><a href="GHC.StgToCmm.Monad.html#cg_loc"><span class="hs-identifier hs-var hs-var">cg_loc</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#CgLoc"><span class="hs-identifier hs-type">CgLoc</span></a></span><span>                     </span><span class="hs-comment">-- CmmExpr for the *tagged* value</span><span>
</span><span id="line-179"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681050286"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-182"></span><span>  </span><span id="local-6989586621681050280"><span class="annot"><span class="annottext">ppr :: CgIdInfo -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cg_id :: CgIdInfo -&gt; Id
</span><a href="GHC.StgToCmm.Monad.html#cg_id"><span class="hs-identifier hs-var">cg_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681050278"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681050278"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cg_loc :: CgIdInfo -&gt; CgLoc
</span><a href="GHC.StgToCmm.Monad.html#cg_loc"><span class="hs-identifier hs-var">cg_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681050277"><span class="annot"><span class="annottext">CgLoc
</span><a href="#local-6989586621681050277"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681050278"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&gt;&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CgLoc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CgLoc
</span><a href="#local-6989586621681050277"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-comment">-- Sequel tells what to do with the result of this expression</span><span>
</span><span id="line-186"></span><span class="hs-keyword">data</span><span> </span><span id="Sequel"><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier hs-var">Sequel</span></a></span></span><span>
</span><span id="line-187"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Return"><span class="annot"><a href="GHC.StgToCmm.Monad.html#Return"><span class="hs-identifier hs-var">Return</span></a></span></span><span>              </span><span class="hs-comment">-- Return result(s) to continuation found on the stack.</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="AssignTo"><span class="annot"><a href="GHC.StgToCmm.Monad.html#AssignTo"><span class="hs-identifier hs-var">AssignTo</span></a></span></span><span>
</span><span id="line-190"></span><span>        </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- Put result(s) in these regs and fall through</span><span>
</span><span id="line-191"></span><span>                        </span><span class="hs-comment">-- NB: no void arguments here</span><span>
</span><span id="line-192"></span><span>                        </span><span class="hs-comment">--</span><span>
</span><span id="line-193"></span><span>        </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>            </span><span class="hs-comment">-- Should we adjust the heap pointer back to</span><span>
</span><span id="line-194"></span><span>                        </span><span class="hs-comment">-- recover space that's unused on this path?</span><span>
</span><span id="line-195"></span><span>                        </span><span class="hs-comment">-- We need to do this only if the expression</span><span>
</span><span id="line-196"></span><span>                        </span><span class="hs-comment">-- may allocate (e.g. it's a foreign call or</span><span>
</span><span id="line-197"></span><span>                        </span><span class="hs-comment">-- allocating primOp)</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681050270"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier hs-type">Sequel</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-200"></span><span>    </span><span id="local-6989586621681050263"><span class="annot"><span class="annottext">ppr :: Sequel -&gt; SDoc
</span><a href="#local-6989586621681050263"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><span class="annottext">Sequel
</span><a href="GHC.StgToCmm.Monad.html#Return"><span class="hs-identifier hs-var">Return</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Return&quot;</span></span><span>
</span><span id="line-201"></span><span>    </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#AssignTo"><span class="hs-identifier hs-type">AssignTo</span></a></span><span> </span><span id="local-6989586621681050262"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050262"><span class="hs-identifier hs-var">regs</span></a></span></span><span> </span><span id="local-6989586621681050261"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681050261"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;AssignTo&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050262"><span class="hs-identifier hs-var">regs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681050261"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="hs-comment">-- See Note [sharing continuations] below</span><span>
</span><span id="line-204"></span><span class="hs-keyword">data</span><span> </span><span id="ReturnKind"><span class="annot"><a href="GHC.StgToCmm.Monad.html#ReturnKind"><span class="hs-identifier hs-var">ReturnKind</span></a></span></span><span>
</span><span id="line-205"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="AssignedDirectly"><span class="annot"><a href="GHC.StgToCmm.Monad.html#AssignedDirectly"><span class="hs-identifier hs-var">AssignedDirectly</span></a></span></span><span>
</span><span id="line-206"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ReturnedTo"><span class="annot"><a href="GHC.StgToCmm.Monad.html#ReturnedTo"><span class="hs-identifier hs-var">ReturnedTo</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span class="hs-comment">-- Note [sharing continuations]</span><span>
</span><span id="line-209"></span><span class="hs-comment">--</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- ReturnKind says how the expression being compiled returned its</span><span>
</span><span id="line-211"></span><span class="hs-comment">-- results: either by assigning directly to the registers specified</span><span>
</span><span id="line-212"></span><span class="hs-comment">-- by the Sequel, or by returning to a continuation that does the</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- assignments.  The point of this is we might be able to re-use the</span><span>
</span><span id="line-214"></span><span class="hs-comment">-- continuation in a subsequent heap-check.  Consider:</span><span>
</span><span id="line-215"></span><span class="hs-comment">--</span><span>
</span><span id="line-216"></span><span class="hs-comment">--    case f x of z</span><span>
</span><span id="line-217"></span><span class="hs-comment">--      True  -&gt; &lt;True code&gt;</span><span>
</span><span id="line-218"></span><span class="hs-comment">--      False -&gt; &lt;False code&gt;</span><span>
</span><span id="line-219"></span><span class="hs-comment">--</span><span>
</span><span id="line-220"></span><span class="hs-comment">-- Naively we would generate</span><span>
</span><span id="line-221"></span><span class="hs-comment">--</span><span>
</span><span id="line-222"></span><span class="hs-comment">--    R2 = x   -- argument to f</span><span>
</span><span id="line-223"></span><span class="hs-comment">--    Sp[young(L1)] = L1</span><span>
</span><span id="line-224"></span><span class="hs-comment">--    call f returns to L1</span><span>
</span><span id="line-225"></span><span class="hs-comment">--  L1:</span><span>
</span><span id="line-226"></span><span class="hs-comment">--    z = R1</span><span>
</span><span id="line-227"></span><span class="hs-comment">--    if (z &amp; 1) then Ltrue else Lfalse</span><span>
</span><span id="line-228"></span><span class="hs-comment">--  Ltrue:</span><span>
</span><span id="line-229"></span><span class="hs-comment">--    Hp = Hp + 24</span><span>
</span><span id="line-230"></span><span class="hs-comment">--    if (Hp &gt; HpLim) then L4 else L7</span><span>
</span><span id="line-231"></span><span class="hs-comment">--  L4:</span><span>
</span><span id="line-232"></span><span class="hs-comment">--    HpAlloc = 24</span><span>
</span><span id="line-233"></span><span class="hs-comment">--    goto L5</span><span>
</span><span id="line-234"></span><span class="hs-comment">--  L5:</span><span>
</span><span id="line-235"></span><span class="hs-comment">--    R1 = z</span><span>
</span><span id="line-236"></span><span class="hs-comment">--    Sp[young(L6)] = L6</span><span>
</span><span id="line-237"></span><span class="hs-comment">--    call stg_gc_unpt_r1 returns to L6</span><span>
</span><span id="line-238"></span><span class="hs-comment">--  L6:</span><span>
</span><span id="line-239"></span><span class="hs-comment">--    z = R1</span><span>
</span><span id="line-240"></span><span class="hs-comment">--    goto L1</span><span>
</span><span id="line-241"></span><span class="hs-comment">--  L7:</span><span>
</span><span id="line-242"></span><span class="hs-comment">--    &lt;True code&gt;</span><span>
</span><span id="line-243"></span><span class="hs-comment">--  Lfalse:</span><span>
</span><span id="line-244"></span><span class="hs-comment">--    &lt;False code&gt;</span><span>
</span><span id="line-245"></span><span class="hs-comment">--</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- We want the gc call in L4 to return to L1, and discard L6.  Note</span><span>
</span><span id="line-247"></span><span class="hs-comment">-- that not only can we share L1 and L6, but the assignment of the</span><span>
</span><span id="line-248"></span><span class="hs-comment">-- return address in L4 is unnecessary because the return address for</span><span>
</span><span id="line-249"></span><span class="hs-comment">-- L1 is already on the stack.  We used to catch the sharing of L1 and</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- L6 in the common-block-eliminator, but not the unnecessary return</span><span>
</span><span id="line-251"></span><span class="hs-comment">-- address assignment.</span><span>
</span><span id="line-252"></span><span class="hs-comment">--</span><span>
</span><span id="line-253"></span><span class="hs-comment">-- Since this case is so common I decided to make it more explicit and</span><span>
</span><span id="line-254"></span><span class="hs-comment">-- robust by programming the sharing directly, rather than relying on</span><span>
</span><span id="line-255"></span><span class="hs-comment">-- the common-block eliminator to catch it.  This makes</span><span>
</span><span id="line-256"></span><span class="hs-comment">-- common-block-elimination an optional optimisation, and furthermore</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- generates less code in the first place that we have to subsequently</span><span>
</span><span id="line-258"></span><span class="hs-comment">-- clean up.</span><span>
</span><span id="line-259"></span><span class="hs-comment">--</span><span>
</span><span id="line-260"></span><span class="hs-comment">-- There are some rarer cases of common blocks that we don't catch</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- this way, but that's ok.  Common-block-elimination is still available</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- to catch them when optimisation is enabled.  Some examples are:</span><span>
</span><span id="line-263"></span><span class="hs-comment">--</span><span>
</span><span id="line-264"></span><span class="hs-comment">--   - when both the True and False branches do a heap check, we</span><span>
</span><span id="line-265"></span><span class="hs-comment">--     can share the heap-check failure code L4a and maybe L4</span><span>
</span><span id="line-266"></span><span class="hs-comment">--</span><span>
</span><span id="line-267"></span><span class="hs-comment">--   - in a case-of-case, there might be multiple continuations that</span><span>
</span><span id="line-268"></span><span class="hs-comment">--     we can common up.</span><span>
</span><span id="line-269"></span><span class="hs-comment">--</span><span>
</span><span id="line-270"></span><span class="hs-comment">-- It is always safe to use AssignedDirectly.  Expressions that jump</span><span>
</span><span id="line-271"></span><span class="hs-comment">-- to the continuation from multiple places (e.g. case expressions)</span><span>
</span><span id="line-272"></span><span class="hs-comment">-- fall back to AssignedDirectly.</span><span>
</span><span id="line-273"></span><span class="hs-comment">--</span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initCgInfoDown"><span class="hs-identifier hs-type">initCgInfoDown</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgInfoDownwards"><span class="hs-identifier hs-type">CgInfoDownwards</span></a></span><span>
</span><span id="line-277"></span><span id="initCgInfoDown"><span class="annot"><span class="annottext">initCgInfoDown :: DynFlags -&gt; Module -&gt; CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#initCgInfoDown"><span class="hs-identifier hs-var hs-var">initCgInfoDown</span></a></span></span><span> </span><span id="local-6989586621681050257"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050257"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681050256"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681050256"><span class="hs-identifier hs-var">mod</span></a></span></span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MkCgInfoDown :: DynFlags
-&gt; Module
-&gt; Int
-&gt; CLabel
-&gt; Sequel
-&gt; Maybe SelfLoopInfo
-&gt; CmmTickScope
-&gt; CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#MkCgInfoDown"><span class="hs-identifier hs-type">MkCgInfoDown</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgd_dflags :: DynFlags
</span><a href="GHC.StgToCmm.Monad.html#cgd_dflags"><span class="hs-identifier hs-var">cgd_dflags</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050257"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-279"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_mod :: Module
</span><a href="GHC.StgToCmm.Monad.html#cgd_mod"><span class="hs-identifier hs-var">cgd_mod</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681050256"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-280"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_updfr_off :: Int
</span><a href="GHC.StgToCmm.Monad.html#cgd_updfr_off"><span class="hs-identifier hs-var">cgd_updfr_off</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#initUpdFrameOff"><span class="hs-identifier hs-var">initUpdFrameOff</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050257"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_ticky :: CLabel
</span><a href="GHC.StgToCmm.Monad.html#cgd_ticky"><span class="hs-identifier hs-var">cgd_ticky</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="GHC.Cmm.CLabel.html#mkTopTickyCtrLabel"><span class="hs-identifier hs-var">mkTopTickyCtrLabel</span></a></span><span>
</span><span id="line-282"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_sequel :: Sequel
</span><a href="GHC.StgToCmm.Monad.html#cgd_sequel"><span class="hs-identifier hs-var">cgd_sequel</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Sequel
</span><a href="GHC.StgToCmm.Monad.html#initSequel"><span class="hs-identifier hs-var">initSequel</span></a></span><span>
</span><span id="line-283"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_self_loop :: Maybe SelfLoopInfo
</span><a href="GHC.StgToCmm.Monad.html#cgd_self_loop"><span class="hs-identifier hs-var">cgd_self_loop</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SelfLoopInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-284"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_tick_scope :: CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#cgd_tick_scope"><span class="hs-identifier hs-var">cgd_tick_scope</span></a></span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="GHC.Cmm.Node.html#GlobalScope"><span class="hs-identifier hs-var">GlobalScope</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initSequel"><span class="hs-identifier hs-type">initSequel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier hs-type">Sequel</span></a></span><span>
</span><span id="line-287"></span><span id="initSequel"><span class="annot"><span class="annottext">initSequel :: Sequel
</span><a href="GHC.StgToCmm.Monad.html#initSequel"><span class="hs-identifier hs-var hs-var">initSequel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Sequel
</span><a href="GHC.StgToCmm.Monad.html#Return"><span class="hs-identifier hs-var">Return</span></a></span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initUpdFrameOff"><span class="hs-identifier hs-type">initUpdFrameOff</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#UpdFrameOffset"><span class="hs-identifier hs-type">UpdFrameOffset</span></a></span><span>
</span><span id="line-290"></span><span id="initUpdFrameOff"><span class="annot"><span class="annottext">initUpdFrameOff :: Platform -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#initUpdFrameOff"><span class="hs-identifier hs-var hs-var">initUpdFrameOff</span></a></span></span><span> </span><span id="local-6989586621681050251"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050251"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050251"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-comment">-- space for the RA</span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-294"></span><span class="hs-comment">--        The code generator state</span><span>
</span><span id="line-295"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="hs-keyword">data</span><span> </span><span id="CgState"><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-var">CgState</span></a></span></span><span>
</span><span id="line-298"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="MkCgState"><span class="annot"><a href="GHC.StgToCmm.Monad.html#MkCgState"><span class="hs-identifier hs-var">MkCgState</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-299"></span><span>     </span><span id="cgs_stmts"><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- Current procedure</span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span>     </span><span id="cgs_tops"><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-302"></span><span>        </span><span class="hs-comment">-- Other procedures and data blocks in this compilation unit</span><span>
</span><span id="line-303"></span><span>        </span><span class="hs-comment">-- Both are ordered only so that we can</span><span>
</span><span id="line-304"></span><span>        </span><span class="hs-comment">-- reduce forward references, when it's easy to do so</span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span>     </span><span id="cgs_binds"><span class="annot"><span class="annottext">CgState -&gt; CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var hs-var">cgs_binds</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgBindings"><span class="hs-identifier hs-type">CgBindings</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span>     </span><span id="cgs_hp_usg"><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span>     </span><span id="cgs_uniqs"><span class="annot"><span class="annottext">CgState -&gt; UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var hs-var">cgs_uniqs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-keyword">data</span><span> </span><span id="HeapUsage"><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-var">HeapUsage</span></a></span></span><span>   </span><span class="hs-comment">-- See Note [Virtual and real heap pointers]</span><span>
</span><span id="line-313"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="HeapUsage"><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-var">HeapUsage</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-314"></span><span>        </span><span id="virtHp"><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var hs-var">virtHp</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- Virtual offset of highest-allocated word</span><span>
</span><span id="line-315"></span><span>                                         </span><span class="hs-comment">--   Incremented whenever we allocate</span><span>
</span><span id="line-316"></span><span>        </span><span id="realHp"><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#realHp"><span class="hs-identifier hs-var hs-var">realHp</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span>        </span><span class="hs-comment">-- realHp: Virtual offset of real heap ptr</span><span>
</span><span id="line-317"></span><span>                                         </span><span class="hs-comment">--   Used in instruction addressing modes</span><span>
</span><span id="line-318"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-keyword">type</span><span> </span><span id="VirtualHpOffset"><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-var">VirtualHpOffset</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-type">WordOff</span></a></span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span class="hs-comment">{- Note [Virtual and real heap pointers]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The code generator can allocate one or more objects contiguously, performing
one heap check to cover allocation of all the objects at once.  Let's call
this little chunk of heap space an &quot;allocation chunk&quot;.  The code generator
will emit code to
  * Perform a heap-exhaustion check
  * Move the heap pointer to the end of the allocation chunk
  * Allocate multiple objects within the chunk

The code generator uses VirtualHpOffsets to address words within a
single allocation chunk; these start at one and increase positively.
The first word of the chunk has VirtualHpOffset=1, the second has
VirtualHpOffset=2, and so on.

 * The field realHp tracks (the VirtualHpOffset) where the real Hp
   register is pointing.  Typically it'll be pointing to the end of the
   allocation chunk.

 * The field virtHp gives the VirtualHpOffset of the highest-allocated
   word so far.  It starts at zero (meaning no word has been allocated),
   and increases whenever an object is allocated.

The difference between realHp and virtHp gives the offset from the
real Hp register of a particular word in the allocation chunk. This
is what getHpRelOffset does.  Since the returned offset is relative
to the real Hp register, it is valid only until you change the real
Hp register.  (Changing virtHp doesn't matter.)
-}</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-type">initCgState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span>
</span><span id="line-355"></span><span id="initCgState"><span class="annot"><span class="annottext">initCgState :: UniqSupply -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-var hs-var">initCgState</span></a></span></span><span> </span><span id="local-6989586621681050240"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050240"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span>
</span><span id="line-356"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MkCgState :: CmmAGraph
-&gt; OrdList CmmDecl
-&gt; CgBindings
-&gt; HeapUsage
-&gt; UniqSupply
-&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#MkCgState"><span class="hs-identifier hs-type">MkCgState</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkNop"><span class="hs-identifier hs-var">mkNop</span></a></span><span>
</span><span id="line-357"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgs_tops :: OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var">cgs_tops</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrdList CmmDecl
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span>
</span><span id="line-358"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgs_binds :: CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var">cgs_binds</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgBindings
forall a. VarEnv a
</span><a href="GHC.Types.Var.Env.html#emptyVarEnv"><span class="hs-identifier hs-var">emptyVarEnv</span></a></span><span>
</span><span id="line-359"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#initHpUsage"><span class="hs-identifier hs-var">initHpUsage</span></a></span><span>
</span><span id="line-360"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgs_uniqs :: UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var">cgs_uniqs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050240"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#stateIncUsage"><span class="hs-identifier hs-type">stateIncUsage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span>
</span><span id="line-363"></span><span class="hs-comment">-- stateIncUsage@ e1 e2 incorporates in e1</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- the heap high water mark found in e2.</span><span>
</span><span id="line-365"></span><span id="stateIncUsage"><span class="annot"><span class="annottext">stateIncUsage :: CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#stateIncUsage"><span class="hs-identifier hs-var hs-var">stateIncUsage</span></a></span></span><span> </span><span id="local-6989586621681050235"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050235"><span class="hs-identifier hs-var">s1</span></a></span></span><span> </span><span id="local-6989586621681050234"><span class="annot"><span class="annottext">s2 :: CgState
</span><a href="#local-6989586621681050234"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#MkCgState"><span class="hs-identifier hs-type">MkCgState</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681050233"><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050233"><span class="hs-identifier hs-var">hp_usg</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050235"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span><span>  </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050235"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">HeapUsage -&gt; Int -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#maxHpHw"><span class="hs-operator hs-var">`maxHpHw`</span></a></span><span>  </span><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var hs-var">virtHp</span></a></span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050233"><span class="hs-identifier hs-var">hp_usg</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-367"></span><span>       </span><span class="annot"><span class="annottext">CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#addCodeBlocksFrom"><span class="hs-operator hs-var">`addCodeBlocksFrom`</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050234"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#addCodeBlocksFrom"><span class="hs-identifier hs-type">addCodeBlocksFrom</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span>
</span><span id="line-370"></span><span class="hs-comment">-- Add code blocks from the latter to the former</span><span>
</span><span id="line-371"></span><span class="hs-comment">-- (The cgs_stmts will often be empty, but not always; see codeOnly)</span><span>
</span><span id="line-372"></span><span id="local-6989586621681050230"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050230"><span class="hs-identifier hs-var">s1</span></a></span></span><span> </span><span id="addCodeBlocksFrom"><span class="annot"><span class="annottext">addCodeBlocksFrom :: CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#addCodeBlocksFrom"><span class="hs-operator hs-var hs-var">`addCodeBlocksFrom`</span></a></span></span><span> </span><span id="local-6989586621681050229"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050229"><span class="hs-identifier hs-var">s2</span></a></span></span><span>
</span><span id="line-373"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050230"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050230"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">CmmGraph.&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050229"><span class="hs-identifier hs-var">s2</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-374"></span><span>         </span><span class="annot"><span class="annottext">cgs_tops :: OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var">cgs_tops</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span><span>  </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050230"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList CmmDecl -&gt; OrdList CmmDecl -&gt; OrdList CmmDecl
forall a. OrdList a -&gt; OrdList a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#appOL"><span class="hs-operator hs-var">`appOL`</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span><span>  </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050229"><span class="hs-identifier hs-var">s2</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-comment">-- The heap high water mark is the larger of virtHp and hwHp.  The latter is</span><span>
</span><span id="line-378"></span><span class="hs-comment">-- only records the high water marks of forked-off branches, so to find the</span><span>
</span><span id="line-379"></span><span class="hs-comment">-- heap high water mark you have to take the max of virtHp and hwHp.  Remember,</span><span>
</span><span id="line-380"></span><span class="hs-comment">-- virtHp never retreats!</span><span>
</span><span id="line-381"></span><span class="hs-comment">--</span><span>
</span><span id="line-382"></span><span class="hs-comment">-- Note Jan 04: ok, so why do we only look at the virtual Hp??</span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#heapHWM"><span class="hs-identifier hs-type">heapHWM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span>
</span><span id="line-385"></span><span id="heapHWM"><span class="annot"><span class="annottext">heapHWM :: HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#heapHWM"><span class="hs-identifier hs-var hs-var">heapHWM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var hs-var">virtHp</span></a></span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#initHpUsage"><span class="hs-identifier hs-type">initHpUsage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span>
</span><span id="line-388"></span><span id="initHpUsage"><span class="annot"><span class="annottext">initHpUsage :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#initHpUsage"><span class="hs-identifier hs-var hs-var">initHpUsage</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage :: Int -&gt; Int -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">virtHp :: Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var">virtHp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">realHp :: Int
</span><a href="GHC.StgToCmm.Monad.html#realHp"><span class="hs-identifier hs-var">realHp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#maxHpHw"><span class="hs-identifier hs-type">maxHpHw</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span>
</span><span id="line-391"></span><span id="local-6989586621681050226"><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050226"><span class="hs-identifier hs-var">hp_usg</span></a></span></span><span> </span><span id="maxHpHw"><span class="annot"><span class="annottext">maxHpHw :: HeapUsage -&gt; Int -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#maxHpHw"><span class="hs-operator hs-var hs-var">`maxHpHw`</span></a></span></span><span> </span><span id="local-6989586621681050225"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050225"><span class="hs-identifier hs-var">hw</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050226"><span class="hs-identifier hs-var">hp_usg</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">virtHp :: Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var">virtHp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var hs-var">virtHp</span></a></span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050226"><span class="hs-identifier hs-var">hp_usg</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">`max`</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050225"><span class="hs-identifier hs-var">hw</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-392"></span><span>
</span><span id="line-393"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-394"></span><span class="hs-comment">-- Operators for getting and setting the state and &quot;info_down&quot;.</span><span>
</span><span id="line-395"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-396"></span><span>
</span><span id="line-397"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-type">getState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span>
</span><span id="line-398"></span><span id="getState"><span class="annot"><span class="annottext">getState :: FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var hs-var">getState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (CgState, CgState)) -&gt; FCode CgState
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; (CgState, CgState))
 -&gt; FCode CgState)
-&gt; (CgInfoDownwards -&gt; CgState -&gt; (CgState, CgState))
-&gt; FCode CgState
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681050223"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050223"><span class="hs-identifier hs-var">_info_down</span></a></span></span><span> </span><span id="local-6989586621681050222"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050222"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050222"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050222"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-type">setState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span id="setState"><span class="annot"><span class="annottext">setState :: CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var hs-var">setState</span></a></span></span><span> </span><span id="local-6989586621681050221"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050221"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; ((), CgState)) -&gt; FCode ()
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; ((), CgState)) -&gt; FCode ())
-&gt; (CgInfoDownwards -&gt; CgState -&gt; ((), CgState)) -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681050220"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050220"><span class="hs-identifier hs-var">_info_down</span></a></span></span><span> </span><span class="annot"><span class="annottext">CgState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050221"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getHpUsage"><span class="hs-identifier hs-type">getHpUsage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span>
</span><span id="line-404"></span><span id="getHpUsage"><span class="annot"><span class="annottext">getHpUsage :: FCode HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#getHpUsage"><span class="hs-identifier hs-var hs-var">getHpUsage</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-405"></span><span>        </span><span id="local-6989586621681050219"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050219"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-406"></span><span>        </span><span class="annot"><span class="annottext">HeapUsage -&gt; FCode HeapUsage
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HeapUsage -&gt; FCode HeapUsage) -&gt; HeapUsage -&gt; FCode HeapUsage
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050219"><span class="hs-identifier hs-var">state</span></a></span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setHpUsage"><span class="hs-identifier hs-type">setHpUsage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#HeapUsage"><span class="hs-identifier hs-type">HeapUsage</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span id="setHpUsage"><span class="annot"><span class="annottext">setHpUsage :: HeapUsage -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setHpUsage"><span class="hs-identifier hs-var hs-var">setHpUsage</span></a></span></span><span> </span><span id="local-6989586621681050218"><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050218"><span class="hs-identifier hs-var">new_hp_usg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-410"></span><span>        </span><span id="local-6989586621681050217"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050217"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-411"></span><span>        </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050217"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050218"><span class="hs-identifier hs-var">new_hp_usg</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-412"></span><span>
</span><span id="line-413"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setVirtHp"><span class="hs-identifier hs-type">setVirtHp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span id="setVirtHp"><span class="annot"><span class="annottext">setVirtHp :: Int -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setVirtHp"><span class="hs-identifier hs-var hs-var">setVirtHp</span></a></span></span><span> </span><span id="local-6989586621681050216"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050216"><span class="hs-identifier hs-var">new_virtHp</span></a></span></span><span>
</span><span id="line-415"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050215"><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050215"><span class="hs-identifier hs-var">hp_usage</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#getHpUsage"><span class="hs-identifier hs-var">getHpUsage</span></a></span><span>
</span><span id="line-416"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HeapUsage -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setHpUsage"><span class="hs-identifier hs-var">setHpUsage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050215"><span class="hs-identifier hs-var">hp_usage</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">virtHp :: Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var">virtHp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050216"><span class="hs-identifier hs-var">new_virtHp</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getVirtHp"><span class="hs-identifier hs-type">getVirtHp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span>
</span><span id="line-419"></span><span id="getVirtHp"><span class="annot"><span class="annottext">getVirtHp :: FCode Int
</span><a href="GHC.StgToCmm.Monad.html#getVirtHp"><span class="hs-identifier hs-var hs-var">getVirtHp</span></a></span></span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050214"><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050214"><span class="hs-identifier hs-var">hp_usage</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#getHpUsage"><span class="hs-identifier hs-var">getHpUsage</span></a></span><span>
</span><span id="line-421"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FCode Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#virtHp"><span class="hs-identifier hs-var hs-var">virtHp</span></a></span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050214"><span class="hs-identifier hs-var">hp_usage</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-422"></span><span>
</span><span id="line-423"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setRealHp"><span class="hs-identifier hs-type">setRealHp</span></a></span><span> </span><span class="hs-glyph">::</span><span>  </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span id="setRealHp"><span class="annot"><span class="annottext">setRealHp :: Int -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setRealHp"><span class="hs-identifier hs-var hs-var">setRealHp</span></a></span></span><span> </span><span id="local-6989586621681050213"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050213"><span class="hs-identifier hs-var">new_realHp</span></a></span></span><span>
</span><span id="line-425"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050212"><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050212"><span class="hs-identifier hs-var">hp_usage</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#getHpUsage"><span class="hs-identifier hs-var">getHpUsage</span></a></span><span>
</span><span id="line-426"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HeapUsage -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setHpUsage"><span class="hs-identifier hs-var">setHpUsage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HeapUsage
</span><a href="#local-6989586621681050212"><span class="hs-identifier hs-var">hp_usage</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">realHp :: Int
</span><a href="GHC.StgToCmm.Monad.html#realHp"><span class="hs-identifier hs-var">realHp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050213"><span class="hs-identifier hs-var">new_realHp</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-427"></span><span>
</span><span id="line-428"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getBinds"><span class="hs-identifier hs-type">getBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgBindings"><span class="hs-identifier hs-type">CgBindings</span></a></span><span>
</span><span id="line-429"></span><span id="getBinds"><span class="annot"><span class="annottext">getBinds :: FCode CgBindings
</span><a href="GHC.StgToCmm.Monad.html#getBinds"><span class="hs-identifier hs-var hs-var">getBinds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-430"></span><span>        </span><span id="local-6989586621681050211"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050211"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-431"></span><span>        </span><span class="annot"><span class="annottext">CgBindings -&gt; FCode CgBindings
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CgBindings -&gt; FCode CgBindings) -&gt; CgBindings -&gt; FCode CgBindings
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var hs-var">cgs_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050211"><span class="hs-identifier hs-var">state</span></a></span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#setBinds"><span class="hs-identifier hs-type">setBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgBindings"><span class="hs-identifier hs-type">CgBindings</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-434"></span><span id="setBinds"><span class="annot"><span class="annottext">setBinds :: CgBindings -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setBinds"><span class="hs-identifier hs-var hs-var">setBinds</span></a></span></span><span> </span><span id="local-6989586621681050210"><span class="annot"><span class="annottext">CgBindings
</span><a href="#local-6989586621681050210"><span class="hs-identifier hs-var">new_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-435"></span><span>        </span><span id="local-6989586621681050209"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050209"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-436"></span><span>        </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050209"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cgs_binds :: CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var">cgs_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgBindings
</span><a href="#local-6989586621681050210"><span class="hs-identifier hs-var">new_binds</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span id="local-6989586621681050628"><span class="annot"><a href="GHC.StgToCmm.Monad.html#withState"><span class="hs-identifier hs-type">withState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050628"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050628"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgState"><span class="hs-identifier hs-type">CgState</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-439"></span><span id="withState"><span class="annot"><span class="annottext">withState :: forall a. FCode a -&gt; CgState -&gt; FCode (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#withState"><span class="hs-identifier hs-var hs-var">withState</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span id="local-6989586621681050207"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="#local-6989586621681050207"><span class="hs-identifier hs-var">fcode</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681050206"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050206"><span class="hs-identifier hs-var">newstate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; ((a, CgState), CgState))
-&gt; FCode (a, CgState)
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; ((a, CgState), CgState))
 -&gt; FCode (a, CgState))
-&gt; (CgInfoDownwards -&gt; CgState -&gt; ((a, CgState), CgState))
-&gt; FCode (a, CgState)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681050205"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050205"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span id="local-6989586621681050204"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050204"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-440"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="#local-6989586621681050207"><span class="hs-identifier hs-var">fcode</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050205"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050206"><span class="hs-identifier hs-var">newstate</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-441"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681050203"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050203"><span class="hs-identifier hs-var">retval</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050202"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050202"><span class="hs-identifier hs-var">state2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050203"><span class="hs-identifier hs-var">retval</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050202"><span class="hs-identifier hs-var">state2</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050204"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#newUniqSupply"><span class="hs-identifier hs-type">newUniqSupply</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span>
</span><span id="line-444"></span><span id="newUniqSupply"><span class="annot"><span class="annottext">newUniqSupply :: FCode UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#newUniqSupply"><span class="hs-identifier hs-var hs-var">newUniqSupply</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-445"></span><span>        </span><span id="local-6989586621681050200"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050200"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-446"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050199"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050199"><span class="hs-identifier hs-var">us1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050198"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050198"><span class="hs-identifier hs-var">us2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (UniqSupply, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#splitUniqSupply"><span class="hs-identifier hs-var">splitUniqSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState -&gt; UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var hs-var">cgs_uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050200"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span>        </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050200"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_uniqs :: UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var">cgs_uniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050199"><span class="hs-identifier hs-var">us1</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-448"></span><span>        </span><span class="annot"><span class="annottext">UniqSupply -&gt; FCode UniqSupply
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050198"><span class="hs-identifier hs-var">us2</span></a></span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier hs-type">newUnique</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span>
</span><span id="line-451"></span><span id="newUnique"><span class="annot"><span class="annottext">newUnique :: FCode Unique
</span><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier hs-var hs-var">newUnique</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-452"></span><span>        </span><span id="local-6989586621681050196"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050196"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-453"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050195"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050195"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050194"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050194"><span class="hs-identifier hs-var">us'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState -&gt; UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var hs-var">cgs_uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050196"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-454"></span><span>        </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050196"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_uniqs :: UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#cgs_uniqs"><span class="hs-identifier hs-var">cgs_uniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050194"><span class="hs-identifier hs-var">us'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-455"></span><span>        </span><span class="annot"><span class="annottext">Unique -&gt; FCode Unique
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050195"><span class="hs-identifier hs-var">u</span></a></span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="hs-comment">------------------</span><span>
</span><span id="line-458"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-type">getInfoDown</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgInfoDownwards"><span class="hs-identifier hs-type">CgInfoDownwards</span></a></span><span>
</span><span id="line-459"></span><span id="getInfoDown"><span class="annot"><span class="annottext">getInfoDown :: FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var hs-var">getInfoDown</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (CgInfoDownwards, CgState))
-&gt; FCode CgInfoDownwards
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; (CgInfoDownwards, CgState))
 -&gt; FCode CgInfoDownwards)
-&gt; (CgInfoDownwards -&gt; CgState -&gt; (CgInfoDownwards, CgState))
-&gt; FCode CgInfoDownwards
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681050193"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050193"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span id="local-6989586621681050192"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050192"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050193"><span class="hs-identifier hs-var">info_down</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050192"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-460"></span><span>
</span><span id="line-461"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getSelfLoop"><span class="hs-identifier hs-type">getSelfLoop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#SelfLoopInfo"><span class="hs-identifier hs-type">SelfLoopInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span id="getSelfLoop"><span class="annot"><span class="annottext">getSelfLoop :: FCode (Maybe SelfLoopInfo)
</span><a href="GHC.StgToCmm.Monad.html#getSelfLoop"><span class="hs-identifier hs-var hs-var">getSelfLoop</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-463"></span><span>        </span><span id="local-6989586621681050191"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050191"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-464"></span><span>        </span><span class="annot"><span class="annottext">Maybe SelfLoopInfo -&gt; FCode (Maybe SelfLoopInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe SelfLoopInfo -&gt; FCode (Maybe SelfLoopInfo))
-&gt; Maybe SelfLoopInfo -&gt; FCode (Maybe SelfLoopInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Maybe SelfLoopInfo
</span><a href="GHC.StgToCmm.Monad.html#cgd_self_loop"><span class="hs-identifier hs-var hs-var">cgd_self_loop</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050191"><span class="hs-identifier hs-var">info_down</span></a></span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span id="local-6989586621681050626"><span class="annot"><a href="GHC.StgToCmm.Monad.html#withSelfLoop"><span class="hs-identifier hs-type">withSelfLoop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#SelfLoopInfo"><span class="hs-identifier hs-type">SelfLoopInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050626"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050626"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-467"></span><span id="withSelfLoop"><span class="annot"><span class="annottext">withSelfLoop :: forall a. SelfLoopInfo -&gt; FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withSelfLoop"><span class="hs-identifier hs-var hs-var">withSelfLoop</span></a></span></span><span> </span><span id="local-6989586621681050189"><span class="annot"><span class="annottext">SelfLoopInfo
</span><a href="#local-6989586621681050189"><span class="hs-identifier hs-var">self_loop</span></a></span></span><span> </span><span id="local-6989586621681050188"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050188"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-468"></span><span>        </span><span id="local-6989586621681050187"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050187"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-469"></span><span>        </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; FCode a
forall a. FCode a -&gt; CgInfoDownwards -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-var">withInfoDown</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050188"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050187"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cgd_self_loop :: Maybe SelfLoopInfo
</span><a href="GHC.StgToCmm.Monad.html#cgd_self_loop"><span class="hs-identifier hs-var">cgd_self_loop</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SelfLoopInfo -&gt; Maybe SelfLoopInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SelfLoopInfo
</span><a href="#local-6989586621681050189"><span class="hs-identifier hs-var">self_loop</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-470"></span><span>
</span><span id="line-471"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HasDynFlags"><span class="hs-identifier hs-type">HasDynFlags</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-472"></span><span>    </span><span id="local-6989586621681050182"><span class="annot"><span class="annottext">getDynFlags :: FCode DynFlags
</span><a href="#local-6989586621681050182"><span class="hs-identifier hs-var hs-var hs-var hs-var">getDynFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; DynFlags)
-&gt; FCode CgInfoDownwards -&gt; FCode DynFlags
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; DynFlags
</span><a href="GHC.StgToCmm.Monad.html#cgd_dflags"><span class="hs-identifier hs-var hs-var">cgd_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-type">getPlatform</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span>
</span><span id="line-475"></span><span id="getPlatform"><span class="annot"><span class="annottext">getPlatform :: FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var hs-var">getPlatform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; Platform) -&gt; FCode DynFlags -&gt; FCode Platform
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-476"></span><span>
</span><span id="line-477"></span><span id="local-6989586621681050624"><span class="annot"><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-type">withInfoDown</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050624"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgInfoDownwards"><span class="hs-identifier hs-type">CgInfoDownwards</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050624"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-478"></span><span id="withInfoDown"><span class="annot"><span class="annottext">withInfoDown :: forall a. FCode a -&gt; CgInfoDownwards -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-var hs-var">withInfoDown</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span id="local-6989586621681050180"><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="#local-6989586621681050180"><span class="hs-identifier hs-var">fcode</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681050179"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050179"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
forall a. (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-var">FCode</span></a></span><span> </span><span class="annot"><span class="annottext">((CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a)
-&gt; (CgInfoDownwards -&gt; CgState -&gt; (a, CgState)) -&gt; FCode a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681050178"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050178"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="#local-6989586621681050180"><span class="hs-identifier hs-var">fcode</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050179"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050178"><span class="hs-identifier hs-var">state</span></a></span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-481"></span><span class="hs-comment">-- Get the current module name</span><span>
</span><span id="line-482"></span><span>
</span><span id="line-483"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getModuleName"><span class="hs-identifier hs-type">getModuleName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-484"></span><span id="getModuleName"><span class="annot"><span class="annottext">getModuleName :: FCode Module
</span><a href="GHC.StgToCmm.Monad.html#getModuleName"><span class="hs-identifier hs-var hs-var">getModuleName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050177"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050177"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; FCode Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Module
</span><a href="GHC.StgToCmm.Monad.html#cgd_mod"><span class="hs-identifier hs-var hs-var">cgd_mod</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050177"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-485"></span><span>
</span><span id="line-486"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-487"></span><span class="hs-comment">-- Get/set the end-of-block info</span><span>
</span><span id="line-488"></span><span>
</span><span id="line-489"></span><span id="local-6989586621681050618"><span class="annot"><a href="GHC.StgToCmm.Monad.html#withSequel"><span class="hs-identifier hs-type">withSequel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier hs-type">Sequel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050618"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050618"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-490"></span><span id="withSequel"><span class="annot"><span class="annottext">withSequel :: forall a. Sequel -&gt; FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withSequel"><span class="hs-identifier hs-var hs-var">withSequel</span></a></span></span><span> </span><span id="local-6989586621681050175"><span class="annot"><span class="annottext">Sequel
</span><a href="#local-6989586621681050175"><span class="hs-identifier hs-var">sequel</span></a></span></span><span> </span><span id="local-6989586621681050174"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050174"><span class="hs-identifier hs-var">code</span></a></span></span><span>
</span><span id="line-491"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050173"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050173"><span class="hs-identifier hs-var">info</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-492"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; FCode a
forall a. FCode a -&gt; CgInfoDownwards -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-var">withInfoDown</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050174"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050173"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cgd_sequel :: Sequel
</span><a href="GHC.StgToCmm.Monad.html#cgd_sequel"><span class="hs-identifier hs-var">cgd_sequel</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Sequel
</span><a href="#local-6989586621681050175"><span class="hs-identifier hs-var">sequel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_self_loop :: Maybe SelfLoopInfo
</span><a href="GHC.StgToCmm.Monad.html#cgd_self_loop"><span class="hs-identifier hs-var">cgd_self_loop</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SelfLoopInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getSequel"><span class="hs-identifier hs-type">getSequel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#Sequel"><span class="hs-identifier hs-type">Sequel</span></a></span><span>
</span><span id="line-495"></span><span id="getSequel"><span class="annot"><span class="annottext">getSequel :: FCode Sequel
</span><a href="GHC.StgToCmm.Monad.html#getSequel"><span class="hs-identifier hs-var hs-var">getSequel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050172"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050172"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-496"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Sequel -&gt; FCode Sequel
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Sequel
</span><a href="GHC.StgToCmm.Monad.html#cgd_sequel"><span class="hs-identifier hs-var hs-var">cgd_sequel</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050172"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-497"></span><span>
</span><span id="line-498"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-499"></span><span class="hs-comment">-- Get/set the size of the update frame</span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span class="hs-comment">-- We keep track of the size of the update frame so that we</span><span>
</span><span id="line-502"></span><span class="hs-comment">-- can set the stack pointer to the proper address on return</span><span>
</span><span id="line-503"></span><span class="hs-comment">-- (or tail call) from the closure.</span><span>
</span><span id="line-504"></span><span class="hs-comment">-- There should be at most one update frame for each closure.</span><span>
</span><span id="line-505"></span><span class="hs-comment">-- Note: I'm including the size of the original return address</span><span>
</span><span id="line-506"></span><span class="hs-comment">-- in the size of the update frame -- hence the default case on `get'.</span><span>
</span><span id="line-507"></span><span>
</span><span id="line-508"></span><span id="local-6989586621681050616"><span class="annot"><a href="GHC.StgToCmm.Monad.html#withUpdFrameOff"><span class="hs-identifier hs-type">withUpdFrameOff</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#UpdFrameOffset"><span class="hs-identifier hs-type">UpdFrameOffset</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050616"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050616"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-509"></span><span id="withUpdFrameOff"><span class="annot"><span class="annottext">withUpdFrameOff :: forall a. Int -&gt; FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withUpdFrameOff"><span class="hs-identifier hs-var hs-var">withUpdFrameOff</span></a></span></span><span> </span><span id="local-6989586621681050170"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050170"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span id="local-6989586621681050169"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050169"><span class="hs-identifier hs-var">code</span></a></span></span><span>
</span><span id="line-510"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050168"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050168"><span class="hs-identifier hs-var">info</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-511"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; FCode a
forall a. FCode a -&gt; CgInfoDownwards -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-var">withInfoDown</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050169"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050168"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cgd_updfr_off :: Int
</span><a href="GHC.StgToCmm.Monad.html#cgd_updfr_off"><span class="hs-identifier hs-var">cgd_updfr_off</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050170"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-512"></span><span>
</span><span id="line-513"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getUpdFrameOff"><span class="hs-identifier hs-type">getUpdFrameOff</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#UpdFrameOffset"><span class="hs-identifier hs-type">UpdFrameOffset</span></a></span><span>
</span><span id="line-514"></span><span id="getUpdFrameOff"><span class="annot"><span class="annottext">getUpdFrameOff :: FCode Int
</span><a href="GHC.StgToCmm.Monad.html#getUpdFrameOff"><span class="hs-identifier hs-var hs-var">getUpdFrameOff</span></a></span></span><span>
</span><span id="line-515"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050167"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050167"><span class="hs-identifier hs-var">info</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-516"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FCode Int
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; FCode Int) -&gt; Int -&gt; FCode Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#cgd_updfr_off"><span class="hs-identifier hs-var hs-var">cgd_updfr_off</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050167"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-517"></span><span>
</span><span id="line-518"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-519"></span><span class="hs-comment">-- Get/set the current ticky counter label</span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getTickyCtrLabel"><span class="hs-identifier hs-type">getTickyCtrLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-522"></span><span id="getTickyCtrLabel"><span class="annot"><span class="annottext">getTickyCtrLabel :: FCode CLabel
</span><a href="GHC.StgToCmm.Monad.html#getTickyCtrLabel"><span class="hs-identifier hs-var hs-var">getTickyCtrLabel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-523"></span><span>        </span><span id="local-6989586621681050166"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050166"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-524"></span><span>        </span><span class="annot"><span class="annottext">CLabel -&gt; FCode CLabel
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CLabel
</span><a href="GHC.StgToCmm.Monad.html#cgd_ticky"><span class="hs-identifier hs-var hs-var">cgd_ticky</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050166"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span id="local-6989586621681050614"><span class="annot"><a href="GHC.StgToCmm.Monad.html#setTickyCtrLabel"><span class="hs-identifier hs-type">setTickyCtrLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050614"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050614"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-527"></span><span id="setTickyCtrLabel"><span class="annot"><span class="annottext">setTickyCtrLabel :: forall a. CLabel -&gt; FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#setTickyCtrLabel"><span class="hs-identifier hs-var hs-var">setTickyCtrLabel</span></a></span></span><span> </span><span id="local-6989586621681050164"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050164"><span class="hs-identifier hs-var">ticky</span></a></span></span><span> </span><span id="local-6989586621681050163"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050163"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-528"></span><span>        </span><span id="local-6989586621681050162"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050162"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-529"></span><span>        </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; FCode a
forall a. FCode a -&gt; CgInfoDownwards -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-var">withInfoDown</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050163"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050162"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cgd_ticky :: CLabel
</span><a href="GHC.StgToCmm.Monad.html#cgd_ticky"><span class="hs-identifier hs-var">cgd_ticky</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050164"><span class="hs-identifier hs-var">ticky</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-530"></span><span>
</span><span id="line-531"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-532"></span><span class="hs-comment">-- Manage tick scopes</span><span>
</span><span id="line-533"></span><span>
</span><span id="line-534"></span><span class="hs-comment">-- | The current tick scope. We will assign this to generated blocks.</span><span>
</span><span id="line-535"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-type">getTickScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmTickScope"><span class="hs-identifier hs-type">CmmTickScope</span></a></span><span>
</span><span id="line-536"></span><span id="getTickScope"><span class="annot"><span class="annottext">getTickScope :: FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var hs-var">getTickScope</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-537"></span><span>        </span><span id="local-6989586621681050161"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050161"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-538"></span><span>        </span><span class="annot"><span class="annottext">CmmTickScope -&gt; FCode CmmTickScope
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#cgd_tick_scope"><span class="hs-identifier hs-var hs-var">cgd_tick_scope</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050161"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-539"></span><span>
</span><span id="line-540"></span><span class="hs-comment">-- | Places blocks generated by the given code into a fresh</span><span>
</span><span id="line-541"></span><span class="hs-comment">-- (sub-)scope. This will make sure that Cmm annotations in our scope</span><span>
</span><span id="line-542"></span><span class="hs-comment">-- will apply to the Cmm blocks generated therein - but not the other</span><span>
</span><span id="line-543"></span><span class="hs-comment">-- way around.</span><span>
</span><span id="line-544"></span><span id="local-6989586621681050612"><span class="annot"><a href="GHC.StgToCmm.Monad.html#tickScope"><span class="hs-identifier hs-type">tickScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050612"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050612"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-545"></span><span id="tickScope"><span class="annot"><span class="annottext">tickScope :: forall a. FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#tickScope"><span class="hs-identifier hs-var hs-var">tickScope</span></a></span></span><span> </span><span id="local-6989586621681050155"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050155"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-546"></span><span>        </span><span id="local-6989586621681050154"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050154"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-547"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#debugLevel"><span class="hs-identifier hs-var hs-var">debugLevel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; DynFlags
</span><a href="GHC.StgToCmm.Monad.html#cgd_dflags"><span class="hs-identifier hs-var hs-var">cgd_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050154"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050155"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-548"></span><span>          </span><span id="local-6989586621681050152"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050152"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Unique
</span><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-549"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050151"><span class="annot"><span class="annottext">scope' :: CmmTickScope
</span><a href="#local-6989586621681050151"><span class="hs-identifier hs-var hs-var">scope'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; CmmTickScope -&gt; CmmTickScope
</span><a href="GHC.Cmm.Node.html#SubScope"><span class="hs-identifier hs-var">SubScope</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050152"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgInfoDownwards -&gt; CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#cgd_tick_scope"><span class="hs-identifier hs-var hs-var">cgd_tick_scope</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050154"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-550"></span><span>          </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; FCode a
forall a. FCode a -&gt; CgInfoDownwards -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#withInfoDown"><span class="hs-identifier hs-var">withInfoDown</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050155"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050154"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgd_tick_scope :: CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#cgd_tick_scope"><span class="hs-identifier hs-var">cgd_tick_scope</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050151"><span class="hs-identifier hs-var">scope'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-551"></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-554"></span><span class="hs-comment">--                 Forking</span><span>
</span><span id="line-555"></span><span class="hs-comment">--------------------------------------------------------</span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkClosureBody"><span class="hs-identifier hs-type">forkClosureBody</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-558"></span><span class="hs-comment">-- forkClosureBody compiles body_code in environment where:</span><span>
</span><span id="line-559"></span><span class="hs-comment">--   - sequel, update stack frame and self loop info are</span><span>
</span><span id="line-560"></span><span class="hs-comment">--     set to fresh values</span><span>
</span><span id="line-561"></span><span class="hs-comment">--   - state is set to a fresh value, except for local bindings</span><span>
</span><span id="line-562"></span><span class="hs-comment">--     that are passed in unchanged. It's up to the enclosed code to</span><span>
</span><span id="line-563"></span><span class="hs-comment">--     re-bind the free variables to a field of the closure.</span><span>
</span><span id="line-564"></span><span>
</span><span id="line-565"></span><span id="forkClosureBody"><span class="annot"><span class="annottext">forkClosureBody :: FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#forkClosureBody"><span class="hs-identifier hs-var hs-var">forkClosureBody</span></a></span></span><span> </span><span id="local-6989586621681050149"><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681050149"><span class="hs-identifier hs-var">body_code</span></a></span></span><span>
</span><span id="line-566"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050148"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050148"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-567"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050147"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050147"><span class="hs-identifier hs-var">info</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-568"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050146"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050146"><span class="hs-identifier hs-var">us</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#newUniqSupply"><span class="hs-identifier hs-var">newUniqSupply</span></a></span><span>
</span><span id="line-569"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050145"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050145"><span class="hs-identifier hs-var">state</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-570"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050144"><span class="annot"><span class="annottext">body_info_down :: CgInfoDownwards
</span><a href="#local-6989586621681050144"><span class="hs-identifier hs-var hs-var">body_info_down</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050147"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgd_sequel :: Sequel
</span><a href="GHC.StgToCmm.Monad.html#cgd_sequel"><span class="hs-identifier hs-var">cgd_sequel</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Sequel
</span><a href="GHC.StgToCmm.Monad.html#initSequel"><span class="hs-identifier hs-var">initSequel</span></a></span><span>
</span><span id="line-571"></span><span>                                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_updfr_off :: Int
</span><a href="GHC.StgToCmm.Monad.html#cgd_updfr_off"><span class="hs-identifier hs-var">cgd_updfr_off</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#initUpdFrameOff"><span class="hs-identifier hs-var">initUpdFrameOff</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050148"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-572"></span><span>                                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgd_self_loop :: Maybe SelfLoopInfo
</span><a href="GHC.StgToCmm.Monad.html#cgd_self_loop"><span class="hs-identifier hs-var">cgd_self_loop</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SelfLoopInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-573"></span><span>              </span><span id="local-6989586621681050143"><span class="annot"><span class="annottext">fork_state_in :: CgState
</span><a href="#local-6989586621681050143"><span class="hs-identifier hs-var hs-var">fork_state_in</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-var">initCgState</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050146"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_binds :: CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var">cgs_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var hs-var">cgs_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050145"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-574"></span><span>              </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span id="local-6989586621681050142"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050142"><span class="hs-identifier hs-var">fork_state_out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode () -&gt; CgInfoDownwards -&gt; CgState -&gt; ((), CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681050149"><span class="hs-identifier hs-var">body_code</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050144"><span class="hs-identifier hs-var">body_info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050143"><span class="hs-identifier hs-var">fork_state_in</span></a></span><span>
</span><span id="line-575"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050145"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#addCodeBlocksFrom"><span class="hs-operator hs-var">`addCodeBlocksFrom`</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050142"><span class="hs-identifier hs-var">fork_state_out</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-576"></span><span>
</span><span id="line-577"></span><span id="local-6989586621681050141"><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkLneBody"><span class="hs-identifier hs-type">forkLneBody</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050141"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050141"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-578"></span><span class="hs-comment">-- 'forkLneBody' takes a body of let-no-escape binding and compiles</span><span>
</span><span id="line-579"></span><span class="hs-comment">-- it in the *current* environment, returning the graph thus constructed.</span><span>
</span><span id="line-580"></span><span class="hs-comment">--</span><span>
</span><span id="line-581"></span><span class="hs-comment">-- The current environment is passed on completely unchanged to</span><span>
</span><span id="line-582"></span><span class="hs-comment">-- the successor.  In particular, any heap usage from the enclosed</span><span>
</span><span id="line-583"></span><span class="hs-comment">-- code is discarded; it should deal with its own heap consumption.</span><span>
</span><span id="line-584"></span><span id="forkLneBody"><span class="annot"><span class="annottext">forkLneBody :: forall a. FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#forkLneBody"><span class="hs-identifier hs-var hs-var">forkLneBody</span></a></span></span><span> </span><span id="local-6989586621681050135"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050135"><span class="hs-identifier hs-var">body_code</span></a></span></span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050134"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050134"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-586"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050133"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050133"><span class="hs-identifier hs-var">us</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#newUniqSupply"><span class="hs-identifier hs-var">newUniqSupply</span></a></span><span>
</span><span id="line-587"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050132"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050132"><span class="hs-identifier hs-var">state</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-588"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050131"><span class="annot"><span class="annottext">fork_state_in :: CgState
</span><a href="#local-6989586621681050131"><span class="hs-identifier hs-var hs-var">fork_state_in</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-var">initCgState</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050133"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_binds :: CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var">cgs_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var hs-var">cgs_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050132"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-589"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681050130"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050130"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050129"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050129"><span class="hs-identifier hs-var">fork_state_out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050135"><span class="hs-identifier hs-var">body_code</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050134"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050131"><span class="hs-identifier hs-var">fork_state_in</span></a></span><span>
</span><span id="line-590"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050132"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#addCodeBlocksFrom"><span class="hs-operator hs-var">`addCodeBlocksFrom`</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050129"><span class="hs-identifier hs-var">fork_state_out</span></a></span><span>
</span><span id="line-591"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">a -&gt; FCode a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050130"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#codeOnly"><span class="hs-identifier hs-type">codeOnly</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- Emit any code from the inner thing into the outer thing</span><span>
</span><span id="line-595"></span><span class="hs-comment">-- Do not affect anything else in the outer state</span><span>
</span><span id="line-596"></span><span class="hs-comment">-- Used in almost-circular code to prevent false loop dependencies</span><span>
</span><span id="line-597"></span><span id="codeOnly"><span class="annot"><span class="annottext">codeOnly :: FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#codeOnly"><span class="hs-identifier hs-var hs-var">codeOnly</span></a></span></span><span> </span><span id="local-6989586621681050128"><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681050128"><span class="hs-identifier hs-var">body_code</span></a></span></span><span>
</span><span id="line-598"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050127"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050127"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-599"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050126"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050126"><span class="hs-identifier hs-var">us</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#newUniqSupply"><span class="hs-identifier hs-var">newUniqSupply</span></a></span><span>
</span><span id="line-600"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050125"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050125"><span class="hs-identifier hs-var">state</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-601"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span>   </span><span id="local-6989586621681050124"><span class="annot"><span class="annottext">fork_state_in :: CgState
</span><a href="#local-6989586621681050124"><span class="hs-identifier hs-var hs-var">fork_state_in</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-var">initCgState</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050126"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_binds :: CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var">cgs_binds</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var hs-var">cgs_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050125"><span class="hs-identifier hs-var">state</span></a></span><span>
</span><span id="line-602"></span><span>                                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050125"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-603"></span><span>                </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050123"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050123"><span class="hs-identifier hs-var">fork_state_out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode () -&gt; CgInfoDownwards -&gt; CgState -&gt; ((), CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681050128"><span class="hs-identifier hs-var">body_code</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050127"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050124"><span class="hs-identifier hs-var">fork_state_in</span></a></span><span>
</span><span id="line-604"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050125"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#addCodeBlocksFrom"><span class="hs-operator hs-var">`addCodeBlocksFrom`</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050123"><span class="hs-identifier hs-var">fork_state_out</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-605"></span><span>
</span><span id="line-606"></span><span id="local-6989586621681050608"><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkAlts"><span class="hs-identifier hs-type">forkAlts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050608"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681050608"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-607"></span><span class="hs-comment">-- (forkAlts' bs d) takes fcodes 'bs' for the branches of a 'case', and</span><span>
</span><span id="line-608"></span><span class="hs-comment">-- an fcode for the default case 'd', and compiles each in the current</span><span>
</span><span id="line-609"></span><span class="hs-comment">-- environment.  The current environment is passed on unmodified, except</span><span>
</span><span id="line-610"></span><span class="hs-comment">-- that the virtual Hp is moved on to the worst virtual Hp for the branches</span><span>
</span><span id="line-611"></span><span>
</span><span id="line-612"></span><span id="forkAlts"><span class="annot"><span class="annottext">forkAlts :: forall a. [FCode a] -&gt; FCode [a]
</span><a href="GHC.StgToCmm.Monad.html#forkAlts"><span class="hs-identifier hs-var hs-var">forkAlts</span></a></span></span><span> </span><span id="local-6989586621681050113"><span class="annot"><span class="annottext">[FCode a]
</span><a href="#local-6989586621681050113"><span class="hs-identifier hs-var">branch_fcodes</span></a></span></span><span>
</span><span id="line-613"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050112"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050112"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-614"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050111"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050111"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode UniqSupply
</span><a href="GHC.StgToCmm.Monad.html#newUniqSupply"><span class="hs-identifier hs-var">newUniqSupply</span></a></span><span>
</span><span id="line-615"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050110"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050110"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-616"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050109"><span class="annot"><span class="annottext">compile :: UniqSupply -&gt; FCode a -&gt; (UniqSupply, (a, CgState))
</span><a href="#local-6989586621681050109"><span class="hs-identifier hs-var hs-var">compile</span></a></span></span><span> </span><span id="local-6989586621681050108"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050108"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621681050107"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050107"><span class="hs-identifier hs-var">branch</span></a></span></span><span>
</span><span id="line-617"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050106"><span class="hs-identifier hs-var">us2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050107"><span class="hs-identifier hs-var">branch</span></a></span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050112"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050105"><span class="hs-identifier hs-var">branch_state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-618"></span><span>                </span><span class="hs-keyword">where</span><span>
</span><span id="line-619"></span><span>                  </span><span class="hs-special">(</span><span id="local-6989586621681050104"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050104"><span class="hs-identifier hs-var">us1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050106"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050106"><span class="hs-identifier hs-var">us2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (UniqSupply, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#splitUniqSupply"><span class="hs-identifier hs-var">splitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050108"><span class="hs-identifier hs-var">us</span></a></span><span>
</span><span id="line-620"></span><span>                  </span><span id="local-6989586621681050105"><span class="annot"><span class="annottext">branch_state :: CgState
</span><a href="#local-6989586621681050105"><span class="hs-identifier hs-var hs-var">branch_state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UniqSupply -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#initCgState"><span class="hs-identifier hs-var">initCgState</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050104"><span class="hs-identifier hs-var">us1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-621"></span><span>                                        </span><span class="annot"><span class="annottext">cgs_binds :: CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var">cgs_binds</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgBindings
</span><a href="GHC.StgToCmm.Monad.html#cgs_binds"><span class="hs-identifier hs-var hs-var">cgs_binds</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050110"><span class="hs-identifier hs-var">state</span></a></span><span>
</span><span id="line-622"></span><span>                                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050110"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-623"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681050103"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050103"><span class="hs-identifier hs-var">_us</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050102"><span class="annot"><span class="annottext">[(a, CgState)]
</span><a href="#local-6989586621681050102"><span class="hs-identifier hs-var">results</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UniqSupply -&gt; FCode a -&gt; (UniqSupply, (a, CgState)))
-&gt; UniqSupply -&gt; [FCode a] -&gt; (UniqSupply, [(a, CgState)])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; FCode a -&gt; (UniqSupply, (a, CgState))
</span><a href="#local-6989586621681050109"><span class="hs-identifier hs-var">compile</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681050111"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">[FCode a]
</span><a href="#local-6989586621681050113"><span class="hs-identifier hs-var">branch_fcodes</span></a></span><span>
</span><span id="line-624"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681050100"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681050100"><span class="hs-identifier hs-var">branch_results</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050099"><span class="annot"><span class="annottext">[CgState]
</span><a href="#local-6989586621681050099"><span class="hs-identifier hs-var">branch_out_states</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, CgState)] -&gt; ([a], [CgState])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, CgState)]
</span><a href="#local-6989586621681050102"><span class="hs-identifier hs-var">results</span></a></span><span>
</span><span id="line-625"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; CgState -&gt; CgState) -&gt; CgState -&gt; [CgState] -&gt; CgState
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CgState -&gt; CgState
</span><a href="GHC.StgToCmm.Monad.html#stateIncUsage"><span class="hs-identifier hs-var">stateIncUsage</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050110"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">[CgState]
</span><a href="#local-6989586621681050099"><span class="hs-identifier hs-var">branch_out_states</span></a></span><span>
</span><span id="line-626"></span><span>                </span><span class="hs-comment">-- NB foldl.  state is the *left* argument to stateIncUsage</span><span>
</span><span id="line-627"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; FCode [a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681050100"><span class="hs-identifier hs-var">branch_results</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-628"></span><span>
</span><span id="line-629"></span><span id="local-6989586621681050597"><span class="annot"><a href="GHC.StgToCmm.Monad.html#forkAltPair"><span class="hs-identifier hs-type">forkAltPair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050597"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050597"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050597"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681050597"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-630"></span><span class="hs-comment">-- Most common use of 'forkAlts'; having this helper function avoids</span><span>
</span><span id="line-631"></span><span class="hs-comment">-- accidental use of failible pattern-matches in @do@-notation</span><span>
</span><span id="line-632"></span><span id="forkAltPair"><span class="annot"><span class="annottext">forkAltPair :: forall a. FCode a -&gt; FCode a -&gt; FCode (a, a)
</span><a href="GHC.StgToCmm.Monad.html#forkAltPair"><span class="hs-identifier hs-var hs-var">forkAltPair</span></a></span></span><span> </span><span id="local-6989586621681050094"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050094"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681050093"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050093"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-633"></span><span>  </span><span id="local-6989586621681050092"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681050092"><span class="hs-identifier hs-var">xy'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[FCode a] -&gt; FCode [a]
forall a. [FCode a] -&gt; FCode [a]
</span><a href="GHC.StgToCmm.Monad.html#forkAlts"><span class="hs-identifier hs-var">forkAlts</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050094"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050093"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-634"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681050092"><span class="hs-identifier hs-var">xy'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-635"></span><span>    </span><span class="hs-special">[</span><span id="local-6989586621681050091"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050091"><span class="hs-identifier hs-var">x'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050090"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050090"><span class="hs-identifier hs-var">y'</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, a) -&gt; FCode (a, a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050091"><span class="hs-identifier hs-var">x'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050090"><span class="hs-identifier hs-var">y'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-636"></span><span>    </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; FCode (a, a)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;forkAltPair&quot;</span></span><span>
</span><span id="line-637"></span><span>
</span><span id="line-638"></span><span class="hs-comment">-- collect the code emitted by an FCode computation</span><span>
</span><span id="line-639"></span><span id="local-6989586621681050594"><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCodeR"><span class="hs-identifier hs-type">getCodeR</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050594"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050594"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-640"></span><span id="getCodeR"><span class="annot"><span class="annottext">getCodeR :: forall a. FCode a -&gt; FCode (a, CmmAGraph)
</span><a href="GHC.StgToCmm.Monad.html#getCodeR"><span class="hs-identifier hs-var hs-var">getCodeR</span></a></span></span><span> </span><span id="local-6989586621681050084"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050084"><span class="hs-identifier hs-var">fcode</span></a></span></span><span>
</span><span id="line-641"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050083"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050083"><span class="hs-identifier hs-var">state1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-642"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050082"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050082"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050081"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050081"><span class="hs-identifier hs-var">state2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgState -&gt; FCode (a, CgState)
forall a. FCode a -&gt; CgState -&gt; FCode (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#withState"><span class="hs-identifier hs-var">withState</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050084"><span class="hs-identifier hs-var">fcode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050083"><span class="hs-identifier hs-var">state1</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkNop"><span class="hs-identifier hs-var">mkNop</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-643"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050081"><span class="hs-identifier hs-var">state2</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050083"><span class="hs-identifier hs-var">state1</span></a></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-644"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, CmmAGraph) -&gt; FCode (a, CmmAGraph)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050082"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050081"><span class="hs-identifier hs-var">state2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span id="local-6989586621681050592"><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCode"><span class="hs-identifier hs-type">getCode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050592"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span></span><span>
</span><span id="line-647"></span><span id="getCode"><span class="annot"><span class="annottext">getCode :: forall a. FCode a -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#getCode"><span class="hs-identifier hs-var hs-var">getCode</span></a></span></span><span> </span><span id="local-6989586621681050078"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050078"><span class="hs-identifier hs-var">fcode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681050077"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050077"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; FCode (a, CmmAGraph)
forall a. FCode a -&gt; FCode (a, CmmAGraph)
</span><a href="GHC.StgToCmm.Monad.html#getCodeR"><span class="hs-identifier hs-var">getCodeR</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050078"><span class="hs-identifier hs-var">fcode</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050077"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-648"></span><span>
</span><span id="line-649"></span><span class="hs-comment">-- | Generate code into a fresh tick (sub-)scope and gather generated code</span><span>
</span><span id="line-650"></span><span id="local-6989586621681050590"><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCodeScoped"><span class="hs-identifier hs-type">getCodeScoped</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050590"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681050590"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-651"></span><span id="getCodeScoped"><span class="annot"><span class="annottext">getCodeScoped :: forall a. FCode a -&gt; FCode (a, CmmAGraphScoped)
</span><a href="GHC.StgToCmm.Monad.html#getCodeScoped"><span class="hs-identifier hs-var hs-var">getCodeScoped</span></a></span></span><span> </span><span id="local-6989586621681050069"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050069"><span class="hs-identifier hs-var">fcode</span></a></span></span><span>
</span><span id="line-652"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050068"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050068"><span class="hs-identifier hs-var">state1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-653"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681050067"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050067"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050066"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050066"><span class="hs-identifier hs-var">tscope</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050065"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050065"><span class="hs-identifier hs-var">state2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-654"></span><span>            </span><span class="annot"><span class="annottext">FCode ((a, CmmTickScope), CgState)
-&gt; FCode ((a, CmmTickScope), CgState)
forall a. FCode a -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#tickScope"><span class="hs-identifier hs-var">tickScope</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode ((a, CmmTickScope), CgState)
 -&gt; FCode ((a, CmmTickScope), CgState))
-&gt; FCode ((a, CmmTickScope), CgState)
-&gt; FCode ((a, CmmTickScope), CgState)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-655"></span><span>            </span><span class="annot"><span class="annottext">(FCode (a, CmmTickScope)
 -&gt; CgState -&gt; FCode ((a, CmmTickScope), CgState))
-&gt; CgState
-&gt; FCode (a, CmmTickScope)
-&gt; FCode ((a, CmmTickScope), CgState)
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">FCode (a, CmmTickScope)
-&gt; CgState -&gt; FCode ((a, CmmTickScope), CgState)
forall a. FCode a -&gt; CgState -&gt; FCode (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#withState"><span class="hs-identifier hs-var">withState</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050068"><span class="hs-identifier hs-var">state1</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkNop"><span class="hs-identifier hs-var">mkNop</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="annot"><span class="annottext">(FCode (a, CmmTickScope) -&gt; FCode ((a, CmmTickScope), CgState))
-&gt; FCode (a, CmmTickScope) -&gt; FCode ((a, CmmTickScope), CgState)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-656"></span><span>            </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050063"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050063"><span class="hs-identifier hs-var">a</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050069"><span class="hs-identifier hs-var">fcode</span></a></span><span>
</span><span id="line-657"></span><span>               </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050062"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050062"><span class="hs-identifier hs-var">scp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var">getTickScope</span></a></span><span>
</span><span id="line-658"></span><span>               </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, CmmTickScope) -&gt; FCode (a, CmmTickScope)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050063"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050062"><span class="hs-identifier hs-var">scp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-659"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050065"><span class="hs-identifier hs-var">state2</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050068"><span class="hs-identifier hs-var">state1</span></a></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-660"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, CmmAGraphScoped) -&gt; FCode (a, CmmAGraphScoped)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050067"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050065"><span class="hs-identifier hs-var">state2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050066"><span class="hs-identifier hs-var">tscope</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-661"></span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span class="hs-comment">-- 'getHeapUsage' applies a function to the amount of heap that it uses.</span><span>
</span><span id="line-664"></span><span class="hs-comment">-- It initialises the heap usage to zeros, and passes on an unchanged</span><span>
</span><span id="line-665"></span><span class="hs-comment">-- heap usage.</span><span>
</span><span id="line-666"></span><span class="hs-comment">--</span><span>
</span><span id="line-667"></span><span class="hs-comment">-- It is usually a prelude to performing a GC check, so everything must</span><span>
</span><span id="line-668"></span><span class="hs-comment">-- be in a tidy and consistent state.</span><span>
</span><span id="line-669"></span><span class="hs-comment">--</span><span>
</span><span id="line-670"></span><span class="hs-comment">-- Note the slightly subtle fixed point behaviour needed here</span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span id="local-6989586621681050584"><span class="annot"><a href="GHC.StgToCmm.Monad.html#getHeapUsage"><span class="hs-identifier hs-type">getHeapUsage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#VirtualHpOffset"><span class="hs-identifier hs-type">VirtualHpOffset</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050584"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681050584"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-673"></span><span id="getHeapUsage"><span class="annot"><span class="annottext">getHeapUsage :: forall a. (Int -&gt; FCode a) -&gt; FCode a
</span><a href="GHC.StgToCmm.Monad.html#getHeapUsage"><span class="hs-identifier hs-var hs-var">getHeapUsage</span></a></span></span><span> </span><span id="local-6989586621681050057"><span class="annot"><span class="annottext">Int -&gt; FCode a
</span><a href="#local-6989586621681050057"><span class="hs-identifier hs-var">fcode</span></a></span></span><span>
</span><span id="line-674"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050056"><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050056"><span class="hs-identifier hs-var">info_down</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgInfoDownwards
</span><a href="GHC.StgToCmm.Monad.html#getInfoDown"><span class="hs-identifier hs-var">getInfoDown</span></a></span><span>
</span><span id="line-675"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050055"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050055"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-676"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span>   </span><span id="local-6989586621681050054"><span class="annot"><span class="annottext">fstate_in :: CgState
</span><a href="#local-6989586621681050054"><span class="hs-identifier hs-var hs-var">fstate_in</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050055"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#initHpUsage"><span class="hs-identifier hs-var">initHpUsage</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-677"></span><span>                </span><span class="hs-special">(</span><span id="local-6989586621681050053"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050053"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050052"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050052"><span class="hs-identifier hs-var">fstate_out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
forall a. FCode a -&gt; CgInfoDownwards -&gt; CgState -&gt; (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#doFCode"><span class="hs-identifier hs-var hs-var">doFCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; FCode a
</span><a href="#local-6989586621681050057"><span class="hs-identifier hs-var">fcode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050051"><span class="hs-identifier hs-var">hp_hw</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CgInfoDownwards
</span><a href="#local-6989586621681050056"><span class="hs-identifier hs-var">info_down</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050054"><span class="hs-identifier hs-var">fstate_in</span></a></span><span>
</span><span id="line-678"></span><span>                </span><span id="local-6989586621681050051"><span class="annot"><span class="annottext">hp_hw :: Int
</span><a href="#local-6989586621681050051"><span class="hs-identifier hs-var hs-var">hp_hw</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HeapUsage -&gt; Int
</span><a href="GHC.StgToCmm.Monad.html#heapHWM"><span class="hs-identifier hs-var">heapHWM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050052"><span class="hs-identifier hs-var">fstate_out</span></a></span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- Loop here!</span><span>
</span><span id="line-679"></span><span>
</span><span id="line-680"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050052"><span class="hs-identifier hs-var">fstate_out</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_hp_usg :: HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var">cgs_hp_usg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; HeapUsage
</span><a href="GHC.StgToCmm.Monad.html#cgs_hp_usg"><span class="hs-identifier hs-var hs-var">cgs_hp_usg</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050055"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-681"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">a -&gt; FCode a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050053"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-682"></span><span>
</span><span id="line-683"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-684"></span><span class="hs-comment">-- Combinators for emitting code</span><span>
</span><span id="line-685"></span><span>
</span><span id="line-686"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-type">emitCgStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CgStmt"><span class="hs-identifier hs-type">CgStmt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-687"></span><span id="emitCgStmt"><span class="annot"><span class="annottext">emitCgStmt :: CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var hs-var">emitCgStmt</span></a></span></span><span> </span><span id="local-6989586621681050049"><span class="annot"><span class="annottext">CgStmt
</span><a href="#local-6989586621681050049"><span class="hs-identifier hs-var">stmt</span></a></span></span><span>
</span><span id="line-688"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050048"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050048"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-689"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050048"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050048"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CgStmt -&gt; CmmAGraph
forall a. OrdList a -&gt; a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#snocOL"><span class="hs-operator hs-var">`snocOL`</span></a></span><span> </span><span class="annot"><span class="annottext">CgStmt
</span><a href="#local-6989586621681050049"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-690"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-691"></span><span>
</span><span id="line-692"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitLabel"><span class="hs-identifier hs-type">emitLabel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span id="emitLabel"><span class="annot"><span class="annottext">emitLabel :: BlockId -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitLabel"><span class="hs-identifier hs-var hs-var">emitLabel</span></a></span></span><span> </span><span id="local-6989586621681050046"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050046"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681050045"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050045"><span class="hs-identifier hs-var">tscope</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var">getTickScope</span></a></span><span>
</span><span id="line-694"></span><span>                  </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgLabel"><span class="hs-identifier hs-var">CgLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050046"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050045"><span class="hs-identifier hs-var">tscope</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitComment"><span class="hs-identifier hs-type">emitComment</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-697"></span><span id="emitComment"><span class="annot"><span class="annottext">emitComment :: FastString -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitComment"><span class="hs-identifier hs-var hs-var">emitComment</span></a></span></span><span> </span><span id="local-6989586621681050043"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681050043"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-698"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Utils.Misc.html#debugIsOn"><span class="hs-identifier hs-var">debugIsOn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O O -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgStmt"><span class="hs-identifier hs-var">CgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmComment"><span class="hs-identifier hs-var">CmmComment</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681050043"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-699"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-700"></span><span>
</span><span id="line-701"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitTick"><span class="hs-identifier hs-type">emitTick</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmTickish"><span class="hs-identifier hs-type">CmmTickish</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-702"></span><span id="emitTick"><span class="annot"><span class="annottext">emitTick :: CmmTickish -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitTick"><span class="hs-identifier hs-var hs-var">emitTick</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="annot"><span class="annottext">(CgStmt -&gt; FCode ())
-&gt; (CmmTickish -&gt; CgStmt) -&gt; CmmTickish -&gt; FCode ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgStmt"><span class="hs-identifier hs-var">CgStmt</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmNode O O -&gt; CgStmt)
-&gt; (CmmTickish -&gt; CmmNode O O) -&gt; CmmTickish -&gt; CgStmt
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickish -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmTick"><span class="hs-identifier hs-var">CmmTick</span></a></span><span>
</span><span id="line-703"></span><span>
</span><span id="line-704"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitUnwind"><span class="hs-identifier hs-type">emitUnwind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#GlobalReg"><span class="hs-identifier hs-type">GlobalReg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-705"></span><span id="emitUnwind"><span class="annot"><span class="annottext">emitUnwind :: [(GlobalReg, Maybe CmmExpr)] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitUnwind"><span class="hs-identifier hs-var hs-var">emitUnwind</span></a></span></span><span> </span><span id="local-6989586621681050037"><span class="annot"><span class="annottext">[(GlobalReg, Maybe CmmExpr)]
</span><a href="#local-6989586621681050037"><span class="hs-identifier hs-var">regs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-706"></span><span>  </span><span id="local-6989586621681050036"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050036"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-707"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; FCode () -&gt; FCode ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#debugLevel"><span class="hs-identifier hs-var hs-var">debugLevel</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050036"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-708"></span><span>     </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="annot"><span class="annottext">(CgStmt -&gt; FCode ()) -&gt; CgStmt -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgStmt"><span class="hs-identifier hs-var">CgStmt</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmNode O O -&gt; CgStmt) -&gt; CmmNode O O -&gt; CgStmt
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(GlobalReg, Maybe CmmExpr)] -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmUnwind"><span class="hs-identifier hs-var">CmmUnwind</span></a></span><span> </span><span class="annot"><span class="annottext">[(GlobalReg, Maybe CmmExpr)]
</span><a href="#local-6989586621681050037"><span class="hs-identifier hs-var">regs</span></a></span><span>
</span><span id="line-709"></span><span>
</span><span id="line-710"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-type">emitAssign</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-711"></span><span id="emitAssign"><span class="annot"><span class="annottext">emitAssign :: CmmReg -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-var hs-var">emitAssign</span></a></span></span><span> </span><span id="local-6989586621681050032"><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681050032"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681050031"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050031"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O O -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgStmt"><span class="hs-identifier hs-var">CgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmAssign"><span class="hs-identifier hs-var">CmmAssign</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681050032"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050031"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-712"></span><span>
</span><span id="line-713"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitStore"><span class="hs-identifier hs-type">emitStore</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-714"></span><span id="emitStore"><span class="annot"><span class="annottext">emitStore :: CmmExpr -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitStore"><span class="hs-identifier hs-var hs-var">emitStore</span></a></span></span><span> </span><span id="local-6989586621681050029"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050029"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681050028"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050028"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O O -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgStmt"><span class="hs-identifier hs-var">CgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmStore"><span class="hs-identifier hs-var">CmmStore</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050029"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050028"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-715"></span><span>
</span><span id="line-716"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-type">emit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-717"></span><span id="emit"><span class="annot"><span class="annottext">emit :: CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var hs-var">emit</span></a></span></span><span> </span><span id="local-6989586621681050026"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050026"><span class="hs-identifier hs-var">ag</span></a></span></span><span>
</span><span id="line-718"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050025"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050025"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-719"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050025"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_stmts :: CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var">cgs_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#cgs_stmts"><span class="hs-identifier hs-var hs-var">cgs_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050025"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">CmmGraph.&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050026"><span class="hs-identifier hs-var">ag</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-720"></span><span>
</span><span id="line-721"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier hs-type">emitDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-722"></span><span id="emitDecl"><span class="annot"><span class="annottext">emitDecl :: CmmDecl -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier hs-var hs-var">emitDecl</span></a></span></span><span> </span><span id="local-6989586621681050024"><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681050024"><span class="hs-identifier hs-var">decl</span></a></span></span><span>
</span><span id="line-723"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050023"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050023"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-724"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050023"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_tops :: OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var">cgs_tops</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681050023"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList CmmDecl -&gt; CmmDecl -&gt; OrdList CmmDecl
forall a. OrdList a -&gt; a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#snocOL"><span class="hs-operator hs-var">`snocOL`</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681050024"><span class="hs-identifier hs-var">decl</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-725"></span><span>
</span><span id="line-726"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitOutOfLine"><span class="hs-identifier hs-type">emitOutOfLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-727"></span><span id="emitOutOfLine"><span class="annot"><span class="annottext">emitOutOfLine :: BlockId -&gt; CmmAGraphScoped -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitOutOfLine"><span class="hs-identifier hs-var hs-var">emitOutOfLine</span></a></span></span><span> </span><span id="local-6989586621681050022"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050022"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050021"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050021"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050020"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050020"><span class="hs-identifier hs-var">tscope</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgStmt -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitCgStmt"><span class="hs-identifier hs-var">emitCgStmt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraph -&gt; CmmTickScope -&gt; CgStmt
</span><a href="GHC.Cmm.Graph.html#CgFork"><span class="hs-identifier hs-var">CgFork</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050022"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050021"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050020"><span class="hs-identifier hs-var">tscope</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-728"></span><span>
</span><span id="line-729"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProcWithStackFrame"><span class="hs-identifier hs-type">emitProcWithStackFrame</span></a></span><span>
</span><span id="line-730"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#Convention"><span class="hs-identifier hs-type">Convention</span></a></span><span>                        </span><span class="hs-comment">-- entry convention</span><span>
</span><span id="line-731"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span>                </span><span class="hs-comment">-- info table?</span><span>
</span><span id="line-732"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>                            </span><span class="hs-comment">-- label for the proc</span><span>
</span><span id="line-733"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmFormal"><span class="hs-identifier hs-type">CmmFormal</span></a></span><span class="hs-special">]</span><span>                       </span><span class="hs-comment">-- stack frame</span><span>
</span><span id="line-734"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmFormal"><span class="hs-identifier hs-type">CmmFormal</span></a></span><span class="hs-special">]</span><span>                       </span><span class="hs-comment">-- arguments</span><span>
</span><span id="line-735"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span>                   </span><span class="hs-comment">-- code</span><span>
</span><span id="line-736"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                              </span><span class="hs-comment">-- do stack layout?</span><span>
</span><span id="line-737"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-738"></span><span>
</span><span id="line-739"></span><span id="emitProcWithStackFrame"><span class="annot"><span class="annottext">emitProcWithStackFrame :: Convention
-&gt; Maybe CmmInfoTable
-&gt; CLabel
-&gt; [LocalReg]
-&gt; [LocalReg]
-&gt; CmmAGraphScoped
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitProcWithStackFrame"><span class="hs-identifier hs-var hs-var">emitProcWithStackFrame</span></a></span></span><span> </span><span id="local-6989586621681050017"><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681050017"><span class="hs-identifier hs-var">_conv</span></a></span></span><span> </span><span id="local-6989586621681050016"><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681050016"><span class="hs-identifier hs-var">mb_info</span></a></span></span><span> </span><span id="local-6989586621681050015"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050015"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681050014"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050014"><span class="hs-identifier hs-var">_stk_args</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681050013"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050013"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-740"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050012"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050012"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-741"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
-&gt; CLabel
-&gt; [GlobalReg]
-&gt; CmmAGraphScoped
-&gt; Int
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitProc"><span class="hs-identifier hs-var">emitProc</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681050016"><span class="hs-identifier hs-var">mb_info</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050015"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050013"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; Int
</span><a href="GHC.Cmm.Type.html#widthInBytes"><span class="hs-identifier hs-var">widthInBytes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050012"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-742"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-743"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProcWithStackFrame"><span class="hs-identifier hs-var">emitProcWithStackFrame</span></a></span><span> </span><span id="local-6989586621681050008"><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681050008"><span class="hs-identifier hs-var">conv</span></a></span></span><span> </span><span id="local-6989586621681050007"><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681050007"><span class="hs-identifier hs-var">mb_info</span></a></span></span><span> </span><span id="local-6989586621681050006"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050006"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681050005"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050005"><span class="hs-identifier hs-var">stk_args</span></a></span></span><span> </span><span id="local-6989586621681050004"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050004"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050003"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050003"><span class="hs-identifier hs-var">graph</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050002"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050002"><span class="hs-identifier hs-var">tscope</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-744"></span><span>        </span><span class="hs-comment">-- do layout</span><span>
</span><span id="line-745"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050001"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050001"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-746"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050000"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050000"><span class="hs-identifier hs-var">offset</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049999"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681049999"><span class="hs-identifier hs-var">live</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049998"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049998"><span class="hs-identifier hs-var">entry</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Convention
-&gt; [LocalReg]
-&gt; [LocalReg]
-&gt; (Int, [GlobalReg], CmmAGraph)
</span><a href="GHC.Cmm.Graph.html#mkCallEntry"><span class="hs-identifier hs-var">mkCallEntry</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681050001"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681050008"><span class="hs-identifier hs-var">conv</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050004"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050005"><span class="hs-identifier hs-var">stk_args</span></a></span><span>
</span><span id="line-747"></span><span>              </span><span id="local-6989586621681049996"><span class="annot"><span class="annottext">graph' :: CmmAGraph
</span><a href="#local-6989586621681049996"><span class="hs-identifier hs-var hs-var">graph'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049998"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">CmmGraph.&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050003"><span class="hs-identifier hs-var">graph</span></a></span><span>
</span><span id="line-748"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
-&gt; CLabel
-&gt; [GlobalReg]
-&gt; CmmAGraphScoped
-&gt; Int
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitProc"><span class="hs-identifier hs-var">emitProc</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681050007"><span class="hs-identifier hs-var">mb_info</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050006"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681049999"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049996"><span class="hs-identifier hs-var">graph'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050002"><span class="hs-identifier hs-var">tscope</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681050000"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-749"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-750"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProcWithStackFrame"><span class="hs-identifier hs-var">emitProcWithStackFrame</span></a></span><span> </span><span class="annot"><span class="annottext">Convention
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FCode ()
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;emitProcWithStackFrame&quot;</span></span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProcWithConvention"><span class="hs-identifier hs-type">emitProcWithConvention</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#Convention"><span class="hs-identifier hs-type">Convention</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-753"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmFormal"><span class="hs-identifier hs-type">CmmFormal</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-754"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span>
</span><span id="line-755"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-756"></span><span id="emitProcWithConvention"><span class="annot"><span class="annottext">emitProcWithConvention :: Convention
-&gt; Maybe CmmInfoTable
-&gt; CLabel
-&gt; [LocalReg]
-&gt; CmmAGraphScoped
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitProcWithConvention"><span class="hs-identifier hs-var hs-var">emitProcWithConvention</span></a></span></span><span> </span><span id="local-6989586621681049995"><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681049995"><span class="hs-identifier hs-var">conv</span></a></span></span><span> </span><span id="local-6989586621681049994"><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681049994"><span class="hs-identifier hs-var">mb_info</span></a></span></span><span> </span><span id="local-6989586621681049993"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681049993"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681049992"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681049992"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681049991"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681049991"><span class="hs-identifier hs-var">blocks</span></a></span></span><span>
</span><span id="line-757"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Convention
-&gt; Maybe CmmInfoTable
-&gt; CLabel
-&gt; [LocalReg]
-&gt; [LocalReg]
-&gt; CmmAGraphScoped
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitProcWithStackFrame"><span class="hs-identifier hs-var">emitProcWithStackFrame</span></a></span><span> </span><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681049995"><span class="hs-identifier hs-var">conv</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681049994"><span class="hs-identifier hs-var">mb_info</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681049993"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681049992"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681049991"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-758"></span><span>
</span><span id="line-759"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#emitProc"><span class="hs-identifier hs-type">emitProc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#GlobalReg"><span class="hs-identifier hs-type">GlobalReg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span>
</span><span id="line-760"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-761"></span><span id="emitProc"><span class="annot"><span class="annottext">emitProc :: Maybe CmmInfoTable
-&gt; CLabel
-&gt; [GlobalReg]
-&gt; CmmAGraphScoped
-&gt; Int
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitProc"><span class="hs-identifier hs-var hs-var">emitProc</span></a></span></span><span> </span><span id="local-6989586621681049990"><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681049990"><span class="hs-identifier hs-var">mb_info</span></a></span></span><span> </span><span id="local-6989586621681049989"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681049989"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681049988"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681049988"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681049987"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681049987"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span id="local-6989586621681049986"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049986"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span id="local-6989586621681049985"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681049985"><span class="hs-identifier hs-var">do_layout</span></a></span></span><span>
</span><span id="line-762"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681049984"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049984"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-763"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-764"></span><span>              </span><span class="annot"><a href="#local-6989586621681049982"><span class="hs-identifier hs-type">blks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-765"></span><span>              </span><span id="local-6989586621681049982"><span class="annot"><span class="annottext">blks :: CmmGraph
</span><a href="#local-6989586621681049982"><span class="hs-identifier hs-var hs-var">blks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraphScoped -&gt; CmmGraph
</span><a href="GHC.Cmm.Graph.html#labelAGraph"><span class="hs-identifier hs-var">labelAGraph</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049984"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681049987"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-766"></span><span>
</span><span id="line-767"></span><span>              </span><span id="local-6989586621681049980"><span class="annot"><span class="annottext">infos :: LabelMap CmmInfoTable
</span><a href="#local-6989586621681049980"><span class="hs-identifier hs-var hs-var">infos</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681049979"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681049979"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe CmmInfoTable
</span><a href="#local-6989586621681049990"><span class="hs-identifier hs-var">mb_info</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSingleton"><span class="hs-identifier hs-var">mapSingleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681049982"><span class="hs-identifier hs-var">blks</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681049979"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-768"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span>              </span><span id="local-6989586621681049975"><span class="annot"><span class="annottext">sinfo :: CmmStackInfo
</span><a href="#local-6989586621681049975"><span class="hs-identifier hs-var hs-var">sinfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackInfo :: Int -&gt; Bool -&gt; CmmStackInfo
</span><a href="GHC.Cmm.html#StackInfo"><span class="hs-identifier hs-type">StackInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">arg_space :: Int
</span><a href="GHC.Cmm.html#arg_space"><span class="hs-identifier hs-var">arg_space</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049986"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-771"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">do_layout :: Bool
</span><a href="GHC.Cmm.html#do_layout"><span class="hs-identifier hs-var">do_layout</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681049985"><span class="hs-identifier hs-var">do_layout</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span>              </span><span id="local-6989586621681049971"><span class="annot"><span class="annottext">tinfo :: CmmTopInfo
</span><a href="#local-6989586621681049971"><span class="hs-identifier hs-var hs-var">tinfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TopInfo :: LabelMap CmmInfoTable -&gt; CmmStackInfo -&gt; CmmTopInfo
</span><a href="GHC.Cmm.html#TopInfo"><span class="hs-identifier hs-type">TopInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681049980"><span class="hs-identifier hs-var">infos</span></a></span><span>
</span><span id="line-774"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">stack_info :: CmmStackInfo
</span><a href="GHC.Cmm.html#stack_info"><span class="hs-identifier hs-var">stack_info</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">CmmStackInfo
</span><a href="#local-6989586621681049975"><span class="hs-identifier hs-var">sinfo</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>              </span><span id="local-6989586621681049967"><span class="annot"><span class="annottext">proc_block :: CmmDecl
</span><a href="#local-6989586621681049967"><span class="hs-identifier hs-var hs-var">proc_block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681049971"><span class="hs-identifier hs-var">tinfo</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681049989"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681049988"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681049982"><span class="hs-identifier hs-var">blks</span></a></span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681049965"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049965"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-779"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049965"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_tops :: OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var">cgs_tops</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049965"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList CmmDecl -&gt; CmmDecl -&gt; OrdList CmmDecl
forall a. OrdList a -&gt; a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#snocOL"><span class="hs-operator hs-var">`snocOL`</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681049967"><span class="hs-identifier hs-var">proc_block</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-780"></span><span>
</span><span id="line-781"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#getCmm"><span class="hs-identifier hs-type">getCmm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGroup"><span class="hs-identifier hs-type">CmmGroup</span></a></span><span>
</span><span id="line-782"></span><span class="hs-comment">-- Get all the CmmTops (there should be no stmts)</span><span>
</span><span id="line-783"></span><span class="hs-comment">-- Return a single Cmm which may be split from other Cmms by</span><span>
</span><span id="line-784"></span><span class="hs-comment">-- object splitting (at a later stage)</span><span>
</span><span id="line-785"></span><span id="getCmm"><span class="annot"><span class="annottext">getCmm :: FCode () -&gt; FCode CmmGroup
</span><a href="GHC.StgToCmm.Monad.html#getCmm"><span class="hs-identifier hs-var hs-var">getCmm</span></a></span></span><span> </span><span id="local-6989586621681049964"><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681049964"><span class="hs-identifier hs-var">code</span></a></span></span><span>
</span><span id="line-786"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681049963"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049963"><span class="hs-identifier hs-var">state1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CgState
</span><a href="GHC.StgToCmm.Monad.html#getState"><span class="hs-identifier hs-var">getState</span></a></span><span>
</span><span id="line-787"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049962"><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049962"><span class="hs-identifier hs-var">state2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode () -&gt; CgState -&gt; FCode ((), CgState)
forall a. FCode a -&gt; CgState -&gt; FCode (a, CgState)
</span><a href="GHC.StgToCmm.Monad.html#withState"><span class="hs-identifier hs-var">withState</span></a></span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681049964"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049963"><span class="hs-identifier hs-var">state1</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_tops :: OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var">cgs_tops</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrdList CmmDecl
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-788"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">(CgState -&gt; FCode ()) -&gt; CgState -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049962"><span class="hs-identifier hs-var">state2</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cgs_tops :: OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var">cgs_tops</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049963"><span class="hs-identifier hs-var">state1</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-789"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmGroup -&gt; FCode CmmGroup
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList CmmDecl -&gt; CmmGroup
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgState -&gt; OrdList CmmDecl
</span><a href="GHC.StgToCmm.Monad.html#cgs_tops"><span class="hs-identifier hs-var hs-var">cgs_tops</span></a></span><span> </span><span class="annot"><span class="annottext">CgState
</span><a href="#local-6989586621681049962"><span class="hs-identifier hs-var">state2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-790"></span><span>
</span><span id="line-791"></span><span>
</span><span id="line-792"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse"><span class="hs-identifier hs-type">mkCmmIfThenElse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-793"></span><span id="mkCmmIfThenElse"><span class="annot"><span class="annottext">mkCmmIfThenElse :: CmmExpr -&gt; CmmAGraph -&gt; CmmAGraph -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse"><span class="hs-identifier hs-var hs-var">mkCmmIfThenElse</span></a></span></span><span> </span><span id="local-6989586621681049960"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049960"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681049959"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049959"><span class="hs-identifier hs-var">tbranch</span></a></span></span><span> </span><span id="local-6989586621681049958"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049958"><span class="hs-identifier hs-var">fbranch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph -&gt; CmmAGraph -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse%27"><span class="hs-identifier hs-var">mkCmmIfThenElse'</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049960"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049959"><span class="hs-identifier hs-var">tbranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049958"><span class="hs-identifier hs-var">fbranch</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-794"></span><span>
</span><span id="line-795"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse%27"><span class="hs-identifier hs-type">mkCmmIfThenElse'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-796"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-797"></span><span id="mkCmmIfThenElse%27"><span class="annot"><span class="annottext">mkCmmIfThenElse' :: CmmExpr -&gt; CmmAGraph -&gt; CmmAGraph -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse%27"><span class="hs-identifier hs-var hs-var">mkCmmIfThenElse'</span></a></span></span><span> </span><span id="local-6989586621681049957"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049957"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681049956"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049956"><span class="hs-identifier hs-var">tbranch</span></a></span></span><span> </span><span id="local-6989586621681049955"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049955"><span class="hs-identifier hs-var">fbranch</span></a></span></span><span> </span><span id="local-6989586621681049954"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049954"><span class="hs-identifier hs-var">likely</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-798"></span><span>  </span><span id="local-6989586621681049953"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049953"><span class="hs-identifier hs-var">tscp</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var">getTickScope</span></a></span><span>
</span><span id="line-799"></span><span>  </span><span id="local-6989586621681049952"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049952"><span class="hs-identifier hs-var">endif</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-800"></span><span>  </span><span id="local-6989586621681049951"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049951"><span class="hs-identifier hs-var">tid</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-801"></span><span>  </span><span id="local-6989586621681049950"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049950"><span class="hs-identifier hs-var">fid</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-802"></span><span>
</span><span id="line-803"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-804"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681049949"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049949"><span class="hs-identifier hs-var">test</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049948"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049948"><span class="hs-identifier hs-var">then_</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049947"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049947"><span class="hs-identifier hs-var">else_</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049946"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049946"><span class="hs-identifier hs-var">likely'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049954"><span class="hs-identifier hs-var">likely</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-805"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681049945"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049945"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Maybe CmmExpr
</span><a href="GHC.Cmm.Expr.html#maybeInvertCmmExpr"><span class="hs-identifier hs-var">maybeInvertCmmExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049957"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-806"></span><span>        </span><span class="hs-comment">-- currently NCG doesn't know about likely</span><span>
</span><span id="line-807"></span><span>        </span><span class="hs-comment">-- annotations. We manually switch then and</span><span>
</span><span id="line-808"></span><span>        </span><span class="hs-comment">-- else branch so the likely false branch</span><span>
</span><span id="line-809"></span><span>        </span><span class="hs-comment">-- becomes a fallthrough.</span><span>
</span><span id="line-810"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049945"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049955"><span class="hs-identifier hs-var">fbranch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049956"><span class="hs-identifier hs-var">tbranch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-811"></span><span>      </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049957"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049956"><span class="hs-identifier hs-var">tbranch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049955"><span class="hs-identifier hs-var">fbranch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049954"><span class="hs-identifier hs-var">likely</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-812"></span><span>
</span><span id="line-813"></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode CmmAGraph) -&gt; CmmAGraph -&gt; FCode CmmAGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmAGraph] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#catAGraphs"><span class="hs-identifier hs-var">catAGraphs</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; BlockId -&gt; BlockId -&gt; Maybe Bool -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkCbranch"><span class="hs-identifier hs-var">mkCbranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049949"><span class="hs-identifier hs-var">test</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049951"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049950"><span class="hs-identifier hs-var">fid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049946"><span class="hs-identifier hs-var">likely'</span></a></span><span>
</span><span id="line-814"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049951"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049953"><span class="hs-identifier hs-var">tscp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049948"><span class="hs-identifier hs-var">then_</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkBranch"><span class="hs-identifier hs-var">mkBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049952"><span class="hs-identifier hs-var">endif</span></a></span><span>
</span><span id="line-815"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049950"><span class="hs-identifier hs-var">fid</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049953"><span class="hs-identifier hs-var">tscp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049947"><span class="hs-identifier hs-var">else_</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049952"><span class="hs-identifier hs-var">endif</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049953"><span class="hs-identifier hs-var">tscp</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-816"></span><span>
</span><span id="line-817"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto"><span class="hs-identifier hs-type">mkCmmIfGoto</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-818"></span><span id="mkCmmIfGoto"><span class="annot"><span class="annottext">mkCmmIfGoto :: CmmExpr -&gt; BlockId -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto"><span class="hs-identifier hs-var hs-var">mkCmmIfGoto</span></a></span></span><span> </span><span id="local-6989586621681049939"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049939"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681049938"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049938"><span class="hs-identifier hs-var">tid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; BlockId -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto%27"><span class="hs-identifier hs-var">mkCmmIfGoto'</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049939"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049938"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-819"></span><span>
</span><span id="line-820"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto%27"><span class="hs-identifier hs-type">mkCmmIfGoto'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-821"></span><span id="mkCmmIfGoto%27"><span class="annot"><span class="annottext">mkCmmIfGoto' :: CmmExpr -&gt; BlockId -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfGoto%27"><span class="hs-identifier hs-var hs-var">mkCmmIfGoto'</span></a></span></span><span> </span><span id="local-6989586621681049937"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049937"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681049936"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049936"><span class="hs-identifier hs-var">tid</span></a></span></span><span> </span><span id="local-6989586621681049935"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049935"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-822"></span><span>  </span><span id="local-6989586621681049934"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049934"><span class="hs-identifier hs-var">endif</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-823"></span><span>  </span><span id="local-6989586621681049933"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049933"><span class="hs-identifier hs-var">tscp</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var">getTickScope</span></a></span><span>
</span><span id="line-824"></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode CmmAGraph) -&gt; CmmAGraph -&gt; FCode CmmAGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmAGraph] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#catAGraphs"><span class="hs-identifier hs-var">catAGraphs</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; BlockId -&gt; BlockId -&gt; Maybe Bool -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkCbranch"><span class="hs-identifier hs-var">mkCbranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049937"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049936"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049934"><span class="hs-identifier hs-var">endif</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049935"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049934"><span class="hs-identifier hs-var">endif</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049933"><span class="hs-identifier hs-var">tscp</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-825"></span><span>
</span><span id="line-826"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen"><span class="hs-identifier hs-type">mkCmmIfThen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-827"></span><span id="mkCmmIfThen"><span class="annot"><span class="annottext">mkCmmIfThen :: CmmExpr -&gt; CmmAGraph -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen"><span class="hs-identifier hs-var hs-var">mkCmmIfThen</span></a></span></span><span> </span><span id="local-6989586621681049932"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049932"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681049931"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049931"><span class="hs-identifier hs-var">tbranch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen%27"><span class="hs-identifier hs-var">mkCmmIfThen'</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049932"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049931"><span class="hs-identifier hs-var">tbranch</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-828"></span><span>
</span><span id="line-829"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen%27"><span class="hs-identifier hs-type">mkCmmIfThen'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-830"></span><span id="mkCmmIfThen%27"><span class="annot"><span class="annottext">mkCmmIfThen' :: CmmExpr -&gt; CmmAGraph -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThen%27"><span class="hs-identifier hs-var hs-var">mkCmmIfThen'</span></a></span></span><span> </span><span id="local-6989586621681049930"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049930"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681049929"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049929"><span class="hs-identifier hs-var">tbranch</span></a></span></span><span> </span><span id="local-6989586621681049928"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049928"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-831"></span><span>  </span><span id="local-6989586621681049927"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049927"><span class="hs-identifier hs-var">endif</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-832"></span><span>  </span><span id="local-6989586621681049926"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049926"><span class="hs-identifier hs-var">tid</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-833"></span><span>  </span><span id="local-6989586621681049925"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049925"><span class="hs-identifier hs-var">tscp</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var">getTickScope</span></a></span><span>
</span><span id="line-834"></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode CmmAGraph) -&gt; CmmAGraph -&gt; FCode CmmAGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmAGraph] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#catAGraphs"><span class="hs-identifier hs-var">catAGraphs</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; BlockId -&gt; BlockId -&gt; Maybe Bool -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkCbranch"><span class="hs-identifier hs-var">mkCbranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049930"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049926"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049927"><span class="hs-identifier hs-var">endif</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681049928"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-835"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049926"><span class="hs-identifier hs-var">tid</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049925"><span class="hs-identifier hs-var">tscp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049929"><span class="hs-identifier hs-var">tbranch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049927"><span class="hs-identifier hs-var">endif</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049925"><span class="hs-identifier hs-var">tscp</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-836"></span><span>
</span><span id="line-837"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCall"><span class="hs-identifier hs-type">mkCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#Convention"><span class="hs-identifier hs-type">Convention</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#Convention"><span class="hs-identifier hs-type">Convention</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmFormal"><span class="hs-identifier hs-type">CmmFormal</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-838"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#UpdFrameOffset"><span class="hs-identifier hs-type">UpdFrameOffset</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-839"></span><span id="mkCall"><span class="annot"><span class="annottext">mkCall :: CmmExpr
-&gt; (Convention, Convention)
-&gt; [LocalReg]
-&gt; [CmmExpr]
-&gt; Int
-&gt; [CmmExpr]
-&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCall"><span class="hs-identifier hs-var hs-var">mkCall</span></a></span></span><span> </span><span id="local-6989586621681049924"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049924"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681049923"><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681049923"><span class="hs-identifier hs-var">callConv</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049922"><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681049922"><span class="hs-identifier hs-var">retConv</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681049921"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681049921"><span class="hs-identifier hs-var">results</span></a></span></span><span> </span><span id="local-6989586621681049920"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681049920"><span class="hs-identifier hs-var">actuals</span></a></span></span><span> </span><span id="local-6989586621681049919"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049919"><span class="hs-identifier hs-var">updfr_off</span></a></span></span><span> </span><span id="local-6989586621681049918"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681049918"><span class="hs-identifier hs-var">extra_stack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-840"></span><span>  </span><span id="local-6989586621681049917"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681049917"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-841"></span><span>  </span><span id="local-6989586621681049916"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049916"><span class="hs-identifier hs-var">k</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-842"></span><span>  </span><span id="local-6989586621681049915"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049915"><span class="hs-identifier hs-var">tscp</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode CmmTickScope
</span><a href="GHC.StgToCmm.Monad.html#getTickScope"><span class="hs-identifier hs-var">getTickScope</span></a></span><span>
</span><span id="line-843"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681049914"><span class="annot"><span class="annottext">area :: Area
</span><a href="#local-6989586621681049914"><span class="hs-identifier hs-var hs-var">area</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Area
</span><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-var">Young</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049916"><span class="hs-identifier hs-var">k</span></a></span><span>
</span><span id="line-844"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681049912"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049912"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681049911"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049911"><span class="hs-identifier hs-var">copyin</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Convention
-&gt; Area
-&gt; [LocalReg]
-&gt; [LocalReg]
-&gt; (Int, [GlobalReg], CmmAGraph)
</span><a href="GHC.Cmm.Graph.html#copyInOflow"><span class="hs-identifier hs-var">copyInOflow</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681049917"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681049922"><span class="hs-identifier hs-var">retConv</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681049914"><span class="hs-identifier hs-var">area</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681049921"><span class="hs-identifier hs-var">results</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-845"></span><span>      </span><span id="local-6989586621681049909"><span class="annot"><span class="annottext">copyout :: CmmAGraph
</span><a href="#local-6989586621681049909"><span class="hs-identifier hs-var hs-var">copyout</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; CmmExpr
-&gt; Convention
-&gt; [CmmExpr]
-&gt; BlockId
-&gt; Int
-&gt; Int
-&gt; [CmmExpr]
-&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkCallReturnsTo"><span class="hs-identifier hs-var">mkCallReturnsTo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681049917"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049924"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Convention
</span><a href="#local-6989586621681049923"><span class="hs-identifier hs-var">callConv</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681049920"><span class="hs-identifier hs-var">actuals</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049916"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049912"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049919"><span class="hs-identifier hs-var">updfr_off</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681049918"><span class="hs-identifier hs-var">extra_stack</span></a></span><span>
</span><span id="line-846"></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode CmmAGraph) -&gt; CmmAGraph -&gt; FCode CmmAGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmAGraph] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#catAGraphs"><span class="hs-identifier hs-var">catAGraphs</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049909"><span class="hs-identifier hs-var">copyout</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLabel"><span class="hs-identifier hs-var">mkLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049916"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681049915"><span class="hs-identifier hs-var">tscp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681049911"><span class="hs-identifier hs-var">copyin</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-847"></span><span>
</span><span id="line-848"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#mkCmmCall"><span class="hs-identifier hs-type">mkCmmCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmFormal"><span class="hs-identifier hs-type">CmmFormal</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#UpdFrameOffset"><span class="hs-identifier hs-type">UpdFrameOffset</span></a></span><span>
</span><span id="line-849"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-850"></span><span id="mkCmmCall"><span class="annot"><span class="annottext">mkCmmCall :: CmmExpr -&gt; [LocalReg] -&gt; [CmmExpr] -&gt; Int -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmCall"><span class="hs-identifier hs-var hs-var">mkCmmCall</span></a></span></span><span> </span><span id="local-6989586621681049907"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049907"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681049906"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681049906"><span class="hs-identifier hs-var">results</span></a></span></span><span> </span><span id="local-6989586621681049905"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681049905"><span class="hs-identifier hs-var">actuals</span></a></span></span><span> </span><span id="local-6989586621681049904"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049904"><span class="hs-identifier hs-var">updfr_off</span></a></span></span><span>
</span><span id="line-851"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
-&gt; (Convention, Convention)
-&gt; [LocalReg]
-&gt; [CmmExpr]
-&gt; Int
-&gt; [CmmExpr]
-&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCall"><span class="hs-identifier hs-var">mkCall</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681049907"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Convention
</span><a href="GHC.Cmm.Node.html#NativeDirectCall"><span class="hs-identifier hs-var">NativeDirectCall</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Convention
</span><a href="GHC.Cmm.Node.html#NativeReturn"><span class="hs-identifier hs-var">NativeReturn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681049906"><span class="hs-identifier hs-var">results</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681049905"><span class="hs-identifier hs-var">actuals</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681049904"><span class="hs-identifier hs-var">updfr_off</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-852"></span><span>
</span><span id="line-853"></span><span>
</span><span id="line-854"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-855"></span><span class="hs-comment">-- turn CmmAGraph into CmmGraph, for making a new proc.</span><span>
</span><span id="line-856"></span><span>
</span><span id="line-857"></span><span class="annot"><a href="GHC.StgToCmm.Monad.html#aGraphToGraph"><span class="hs-identifier hs-type">aGraphToGraph</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-858"></span><span id="aGraphToGraph"><span class="annot"><span class="annottext">aGraphToGraph :: CmmAGraphScoped -&gt; FCode CmmGraph
</span><a href="GHC.StgToCmm.Monad.html#aGraphToGraph"><span class="hs-identifier hs-var hs-var">aGraphToGraph</span></a></span></span><span> </span><span id="local-6989586621681049901"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681049901"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-859"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681049900"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049900"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-860"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; FCode CmmGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraphScoped -&gt; CmmGraph
</span><a href="GHC.Cmm.Graph.html#labelAGraph"><span class="hs-identifier hs-var">labelAGraph</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681049900"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681049901"><span class="hs-identifier hs-var">stmts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-861"></span></pre></body></html>